Throwing StopIteration in array extras to stop the iteration

Andrea Giammarchi andrea.giammarchi at
Sun Mar 3 18:53:13 PST 2013

well, lastMatch is 9 chars against ['$&'] 6 but actually didn't know about
lastMatch, it looks like to have more info about those properties, included
lastParen, I had to check msdn rather than MDN since latter does not
mention it while mans shows an example:

So, good to know ... in any case, I wrote that was hacky and usually hacky
and looking good do not cope with each other ;-)

Also nobody mentioned here, neither I did in my post, about performance ...
a for loop is at least twice as fast as any of these methods :-/


On Sun, Mar 3, 2013 at 4:26 PM, Brendan Eich <brendan at> wrote:

> Brendan Eich wrote:
>  Andrea Giammarchi wrote:
>>> RegExp['$&'];
>> My Perl 4 _homage_, blechh.
> (You could at least have had the decency to use RegExp.lastMatch... ;-)
> /be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list