https://github.com/python/cpython/commit/4b5e9d817a834f9d3270b998f64ebf57faa78166 commit: 4b5e9d817a834f9d3270b998f64ebf57faa78166 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-07-05T11:22:38+03:00 summary:
[3.13] gh-151819: Clarify the conditional-pattern email example in re docs (GH-153072) (GH-153075) 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 5c7aadb03dad3a..a855a6b8ff2eff 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]
