[issue433024] SRE: (?flag) isn't properly scoped

Alexander Belopolsky report at bugs.python.org
Mon Mar 17 15:01:52 CET 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

This is still a valid issue. (As of Python 2.6a1+ (trunk:61434, Mar 17 
2008, 08:06:54).)

>>> bool(re.match("abc(?i)","AbC"))
True

The documentation says that the behavior of a regex with (?<letter>) not 
at the beginning is undefined.

Short of implementing Java/Perl behavior, this should be made an error 
rather than undefined so that users porting their code from Java/Perl 
get an early warning.

----------
nosy: +belopolsky

____________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue433024>
____________________________________


More information about the Python-bugs-list mailing list