[Python-Dev] one last SRE headache (original) (raw)

Tim Peters tim_one@email.msn.com
Thu, 31 Aug 2000 17:01:10 -0400


Suggestion:

If there are fewer than 3 digits, it's a group.

Unless it begins with a 0 (that's what's documented today -- read the docs ).

If there are exactly 3 digits and you have 100 or more groups, it's a group -- too bad, you lose octal number support. Use \x. :-)

The docs say you can't use backreferences for groups higher than 99.

If there are exactly 3 digits and you have at most 99 groups, it's an octal escape.

If we make the meaning depend on the number of preceding groups, we may as well emulate all of Perl's ugliness here.