Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Mike Samuel
2011/7/7 Lasse Reichstein reichsteinatw...@gmail.com: On Thu, Jul 7, 2011 at 3:52 AM, Mike Samuel mikesam...@gmail.com 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

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Mike Samuel
2011/7/7 Mike Samuel mikesam...@gmail.com: Interestingly other perl 5 interpreters other perl 5 interpreters - other perl 5 style regex libraries ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Oliver Hunt
CC'ing Gavin as he's been looking at RegExp compatibility in the real world vs. the spec recently. --Oliver On Jul 7, 2011, at 12:17 PM, Mike Samuel wrote: 2011/7/7 Lasse Reichstein reichsteinatw...@gmail.com: On Thu, Jul 7, 2011 at 3:52 AM, Mike Samuel mikesam...@gmail.com wrote:

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Lasse Reichstein
On Thu, 07 Jul 2011 21:17:17 +0200, Mike Samuel mikesam...@gmail.com wrote: One way to tell whether the group initialized to empty works on an interpreter is to test /^(?:\1x(y)x){2}$/.test(xyxyxyx) which is true in most interpreters, but false in Rhino1.7 and Chrome12. I do believe it

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Brendan Eich
On Jul 7, 2011, at 2:40 PM, Lasse Reichstein wrote: On Thu, 07 Jul 2011 21:17:17 +0200, Mike Samuel mikesam...@gmail.com wrote: One way to tell whether the group initialized to empty works on an interpreter is to test /^(?:\1x(y)x){2}$/.test(xyxyxyx) which is true in most interpreters,

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Gavin Barraclough
On Jul 7, 2011, at 2:40 PM, Lasse Reichstein wrote: On Thu, 07 Jul 2011 21:17:17 +0200, Mike Samuel One way to tell whether the group initialized to empty works on an interpreter is to test /^(?:\1x(y)x){2}$/.test(xyxyxyx) which is true in most interpreters, but false in Rhino1.7 and

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Mike Samuel
2011/7/7 Brendan Eich bren...@mozilla.com: On Jul 7, 2011, at 2:40 PM, Lasse Reichstein wrote: On Thu, 07 Jul 2011 21:17:17 +0200, Mike Samuel mikesam...@gmail.com wrote: One way to tell whether the group initialized to empty works on an interpreter is to test    

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Gavin Barraclough
On Jul 7, 2011, at 2:59 PM, Mike Samuel wrote: Agreed. Would that mean that /^(?:\1x(y)x){2}$/.test(xyxxyx) !/^(?:\1x(y)x){2}$/.test(xyxyxyx) If so, V8 agrees with that, the species of monkey in FF 5 does not, the JsCore in Safari 533.21 does not, and Rhino does. Yes. This is

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Mike Samuel
2011/7/7 Gavin Barraclough barraclo...@apple.com: On Jul 7, 2011, at 2:59 PM, Mike Samuel wrote: Agreed. Would that mean that    /^(?:\1x(y)x){2}$/.test(xyxxyx) !/^(?:\1x(y)x){2}$/.test(xyxyxyx) If so, V8 agrees with that, the species of monkey in FF 5 does not, the JsCore in Safari

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Brendan Eich
On Jul 7, 2011, at 3:27 PM, Gavin Barraclough wrote: On Jul 7, 2011, at 2:59 PM, Mike Samuel wrote: Agreed. Would that mean that /^(?:\1x(y)x){2}$/.test(xyxxyx) !/^(?:\1x(y)x){2}$/.test(xyxyxyx) If so, V8 agrees with that, the species of monkey in FF 5 does not, the JsCore in

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-07 Thread Brendan Eich
On Jul 7, 2011, at 3:34 PM, Mike Samuel wrote: 2011/7/7 Gavin Barraclough barraclo...@apple.com: On Jul 7, 2011, at 2:59 PM, Mike Samuel wrote: Agreed. Would that mean that /^(?:\1x(y)x){2}$/.test(xyxxyx) !/^(?:\1x(y)x){2}$/.test(xyxyxyx) If so, V8 agrees with that, the species

/\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-06 Thread Dave Fugate
var x = /\1/; According to 15.10.2.11, the RegExp snippet above should throw something as there aren't any capturing parenthesis within the RegExp, yet one is referenced. Just now noticed that step 4 of 15.10.2.9 is more precise and shows a SyntaxError gets thrown. Isn't the

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-06 Thread Allen Wirfs-Brock
On Jul 6, 2011, at 4:35 PM, Dave Fugate wrote: var x = /\1/; According to 15.10.2.11, the RegExp snippet above should throw something as there aren’t any capturing parenthesis within the RegExp, yet one is referenced. Just now noticed that step 4 of 15.10.2.9 is more

Re: /\1/ could be a valid RegExp through Chapter 16 Extension clause?

2011-07-06 Thread Mike Samuel
2011/7/6 Dave Fugate dfug...@microsoft.com:     var x = /\1/; According to 15.10.2.11, the RegExp snippet above should throw something as there aren’t any capturing parenthesis within the RegExp, yet one is referenced.  Just now noticed that step 4 of 15.10.2.9 is more precise