On Thu, Jul 7, 2011 at 3:52 AM, Mike Samuel <[email protected]> wrote:
> Yes, by the extension, and whether a \<octal> is a backreference or an
> octal escape sequence is determined by whether there are
> parseInt(<octal>, 10) capturing groups to the left of it in the
> regular expression.
> So
> /\1(foo)\1/
> matches the same language as
> /\u0001(foo)\1/
>
I don't think thats correct.
The \1 is a valid DecimalEscape, its value is 1, which is not greater than
NCapturingParens in 15.10.2.9 step 7 (NCapturingParens is defined globally
for the pattern, not just to the left of the current escape). I.e., it is
not a Syntax Error, so the \1 must be treated as a back-reference. It will
always be to a non-participating capture, so the regexp is equivalent to
/(foo)\1/
or just
/(foo)foo/
but never to
/\u0001(foo)foo/
Regards
/Lasse
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss