https://github.com/python/cpython/commit/14568f4acfc56613483b4661ccde3c3e0363ce3c commit: 14568f4acfc56613483b4661ccde3c3e0363ce3c branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-07-05T11:23:10+03:00 summary:
[3.15] gh-151819: Clarify the conditional-pattern email example in re docs (GH-153072) (GH-153073) 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 4745c1b98a4554..c8375f4d6a0527 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -509,8 +509,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]
