Backreferences compile to something like \2. But backreferences can't be directly followed by a digit, since \20 is interpreted either as the 20th capturing group, or as an octal escape.
To Reproduce
:() ::1 "0"
produces ()\10
Expected behavior
Either the backreference must be wrapped in a non-capturing group, or the following digit must be put in a character set:
Describe the bug
Backreferences compile to something like
\2
. But backreferences can't be directly followed by a digit, since\20
is interpreted either as the 20th capturing group, or as an octal escape.To Reproduce
produces
()\10
Expected behavior
Either the backreference must be wrapped in a non-capturing group, or the following digit must be put in a character set:
()(?:\1)0
()\1[0]
Additional context
Version 0.10