Throwing StopIteration in array extras to stop the iteration

Andrea Giammarchi andrea.giammarchi at gmail.com
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:
http://msdn.microsoft.com/en-us/library/ie/3k9c4a32(v=vs.94).aspx

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 :-/

br




On Sun, Mar 3, 2013 at 4:26 PM, Brendan Eich <brendan at mozilla.com> 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: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130303/ab93adf2/attachment.html>


More information about the es-discuss mailing list