in reply to In substituation regex, how to differentiate \1 from surrounding text

According to perlre:

There is no limit to the number of captured substrings that you may use. However Perl also uses \10, \11, etc. as aliases for \010, \011, etc. (Recall that 0 means octal, so \011 is the character at number 9 in your coded character set; which would be the 10th character, a horizontal tab under ASCII.) Perl resolves this ambiguity by interpreting \10 as a backreference only if at least 10 left parentheses have opened before it. Likewise \11 is a backreference only if at least 11 left parentheses have opened before it. And so on. \1 through \9 are always interpreted as backreferences

So unless you have 155(or 15) open parens before you shouldn't have a problem .. but you should read Warning on \1 vs $1 (also in perlre as well)...

-enlil

  • Comment on Re: In substitution regex, how to differentiate \1 from surrounding text