[issue38582] re: backreference number in replace string can't >= 100

Matthew Barnett report at bugs.python.org
Thu Oct 24 13:15:46 EDT 2019


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

A numeric escape of 3 digits is an octal (base 8) escape; the octal escape "\100" gives the same character as the hexadecimal escape "\x40".

In a replacement template, you can use "\g<100>" if you want group 100 because \g<...> accepts both numeric and named group references.

However, \g<...> is not accepted in a pattern.

(By the way, in the "regex" module I added support for it in a pattern too.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38582>
_______________________________________


More information about the Python-bugs-list mailing list