[issue2636] Adding a new regex module (compatible with re)
Ezio Melotti
report at bugs.python.org
Thu Sep 1 20:40:00 CEST 2011
Ezio Melotti <ezio.melotti at gmail.com> added the comment:
Changing the name of the flag is fine with me.
Having a warning for unescaped brackets that trigger set operations might also be a solution (once escaped they will still work on the old re). Maybe the same could also be done for scoped flags.
FWIW I tried to come up with a simpler regex that makes some sense and triggers unwanted set operations and I didn't come up with anything except:
>>> regex.findall('[[(]foo[)]]', '[[foo] (foo)]')
['f', 'o', 'o', '(', 'f', 'o', 'o', ')']
>>> re.findall('[[(]foo[)]]', '[[foo] (foo)]')
['(foo)]']
(but this doesn't make too much sense). Complex regex will still break though, so the issue needs to be addressed somehow.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________
More information about the Python-bugs-list
mailing list