Leon Hampton <leon_hamp...@yahoo.com> added the comment:

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 '<u...@host.com'. In my tests the pattern MATCHES the string.
I agree that the pattern should not match.
Respectfully,
Leon

----------
components: +Regular Expressions -Documentation
nosy: +ezio.melotti, mrabarnett
title: Poor RegEx example for (?(id/name)yes-pattern|no-pattern) -> RegExp 
Conditional Construct (?(id/name)yes-pattern|no-pattern) Problem

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40043>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to