[issue20678] re does not allow back references in {} matching operator

steven Michalske report at bugs.python.org
Wed Feb 19 02:04:02 CET 2014


steven Michalske added the comment:

The RE compiler will not error out, with a back reference in there...
It treats the {\1} as a literal {\1} in the string.

In [180]: re.search("(\d) fo.{\1}", '3 foo{\1}').group(0)
Out[180]: '3 foo{\x01}'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20678>
_______________________________________


More information about the Python-bugs-list mailing list