https://github.com/python/cpython/commit/b1faa43d84513e82da3bafd8d0a6e321d90a2d0d
commit: b1faa43d84513e82da3bafd8d0a6e321d90a2d0d
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-05T11:22:55+03:00
summary:

[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 '<[email protected]' outright --
re.search finds '[email protected]' in it; it only fails to match the
whole string.  Reword to say so.
(cherry picked from commit fe9c7213e6576e27ebff6ef039706cd463593310)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Doc/library/re.rst

diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 6fbe8993ee223d..456d74292ef4a7 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 ``'<[email protected]>'`` as well as ``'[email protected]'``, but
-   not with ``'<[email protected]'`` nor ``'[email protected]>'``.
+   matches ``'<[email protected]>'`` as well as ``'[email protected]'``, but does not
+   match ``'<[email protected]'`` nor ``'[email protected]>'`` in their entirety
+   (:func:`re.search` finds only ``'[email protected]'`` in the former).
 
    .. versionchanged:: 3.12
       Group *id* can only contain ASCII digits.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to