This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author LHampton
Recipients LHampton, docs@python, ezio.melotti, mrabarnett
Date 2020-03-22.17:55:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584899741.37.0.154796453538.issue40043@roundup.psfhosted.org>
In-reply-to
Content
Hello,
There may be a bug in the implementation of the Conditional Construction of Regular Expressions, namely the (?(id/name)yes-pattern|no-pattern).
In the Regular Expression documentation (https://docs.python.org/3.7/library/re.html), in the portion about the Conditional Construct, it gives this sample pattern '(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)' and states that the pattern WILL NOT MATCH this string '<user@host.com'. In my tests the pattern MATCHES the string.
I agree that the pattern should not match.
Respectfully,
Leon
History
Date User Action Args
2020-03-22 17:55:41LHamptonsetrecipients: + LHampton, ezio.melotti, mrabarnett, docs@python
2020-03-22 17:55:41LHamptonsetmessageid: <1584899741.37.0.154796453538.issue40043@roundup.psfhosted.org>
2020-03-22 17:55:41LHamptonlinkissue40043 messages
2020-03-22 17:55:41LHamptoncreate