New submission from Leon Hampton <leon_hamp...@yahoo.com>:

Hello,
In the 3.7.7 documentation on Regular Expression, the Conditional Construct, 
(?(id/name)yes-pattern|no-pattern), is discussed. (This is a very thorough 
document, by the way. Good job!)
One example given for the Conditional Construct does not work as described. 
Specifically, the example gives this matching pattern 
'(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)' and states that it will NOT MATCH the string 
'<u...@host.com'. In my tests the pattern DOES MATCH that string.
(The other examples work as described.) 
This may be a bug in re since it seems to me that the match should fail.
Respectfully,
Leon

----------
assignee: docs@python
components: Documentation
messages: 364811
nosy: LHampton, docs@python
priority: normal
severity: normal
status: open
title: Poor RegEx example for (?(id/name)yes-pattern|no-pattern)
type: behavior
versions: Python 3.7

_______________________________________
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