Jason Orendorff <[EMAIL PROTECTED]> added the comment: Huh. Maybe you're right. JavaScript, Ruby, and Perl all accept both regexes, although no two agree on what should be captured:
js> "xyyzy".replace(/((x|y)*)*/, "($1, $2)") (xyy, y)zy js> "xyyzy".replace(/((x|y+)*)*/, "($1, $2)") (xyy, yy)zy >> "xyyzy".sub(/((x|y)*)*/, "(\\1, \\2)") => "(, y)zy" >> "xyyzy".sub(/((x|y+)*)*/, "(\\1, \\2)") => "(, yy)zy" DB<1> $_ = 'xyyzy'; s/((x|y)*)*/(\1 \2)/; print ( )zy DB<2> $_ = 'xyyzy'; s/((x|y+)*)*/(\1 \2)/; print ( yy)zy Ruby's behavior seems best to me. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2537> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com