Regexp capturing groups.

Markus Jarderot marjar-4 at student.ltu.se
Mon Sep 15 11:51:41 PDT 2008


Brendan Eich wrote:
> Steven did file
>
> http://bugs.ecmascript.org/ticket/376
>
> I'll champion fixing this, somehow, in Harmony. We should get  
> Waldemar's opinion on it.
>
> /be

#376 seems to only concern the issue of back-references to 
non-participating capture-groups.
What I described was back-references to capture-groups within a 
repetition. As the algorithm in the ECMA-262v3 is currently written, any 
captures from the last iteration should be discarded.
#376 mentions it, but also says that this deserves a separate ticket. I 
have not found any ticket on this specific issue.

I have recently found that also Google Chrome keeps the captures between 
iterations.

URI: javascript:alert(/(?:(a)|(b))*/.exec("ababa"))

Firefox 3.0.1:
"ababa,a," <-- no "b"

Internet Explorer 7.0.5730.11 and Google Chrome 0.2.149.29:
"ababa,a,b" <-- "b" in the end

--
Markus Jarderot


More information about the Es-discuss mailing list