[issue2636] Regexp 2.7 (modifications to current re 2.2.2)
Matthew Barnett
report at bugs.python.org
Wed Sep 24 16:28:03 CEST 2008
Matthew Barnett <python at mrabarnett.plus.com> added the comment:
Comparing item 2 and item 3, I think that item 3 is the Pythonic choice
and item 2 is a bad idea.
Item 4: back-references in the pattern are like \1 and (?P=name), not
\g<1> or \g<name>, and in the replacement string are like \g<1> and
\g<name>, not \1 (or (?P=name)). I'd like to suggest that
back-references in the pattern also include \g<1> and \g<name> and
\g<-1> for relative back-references. Interestingly, Perl names groups
with (?<name>...) whereas Python uses (?P<name>...). A permissible
alternative?
----------
nosy: +mrabarnett
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2636>
_______________________________________
More information about the Python-bugs-list
mailing list