From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 5 Jul 2026 08:22:55 +0000 (+0200) Subject: [3.14] gh-151819: Clarify the conditional-pattern email example in re docs (GH-153072... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1faa43d84513e82da3bafd8d0a6e321d90a2d0d;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-151819: Clarify the conditional-pattern email example in re docs (GH-153072) (GH-153074) The example pattern does not fail to match ' Co-authored-by: Claude Opus 4.8 --- diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 6fbe8993ee22..456d74292ef4 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -512,8 +512,9 @@ The special characters are: *name* exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is optional and can be omitted. For example, ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)`` is a poor email matching pattern, which - will match with ``''`` as well as ``'user@host.com'``, but - not with ``''``. + matches ``''`` as well as ``'user@host.com'``, but does not + match ``''`` in their entirety + (:func:`re.search` finds only ``'user@host.com'`` in the former). .. versionchanged:: 3.12 Group *id* can only contain ASCII digits.