[thelist] non-greedy javascript regex in mac

Liorean Liorean at user.bip.net
Mon Feb 25 15:35:00 CST 2002


At 14:01 2002-02-25 -0500, Bill Lovett wrote:
>Is there a javascript regex master in the house? I'm parsing an xml
>file on the client side and running into a greediness problem. I know
>that I can get a non-greedy match on a pc by using ?, but this doesn't
>seem to work from IE mac. Has anyone else run into this before?
>
>I know of at least one js library out there aimed at xml parsing, xml
>for script, but it's really  really slow on a mac (the dom parser, at
>least) and regular expressions seemed like the best alternative. If
>anyone has other suggestions I'd love to hear them.
>
>-bill

I don't really know if this is the case for IE mac, since the mac version
is so different from the windows version, but on windows version non-greedy
matches were added either version 5.5 or 6.0 (I think it was 5.5, but I
can't confirm...), so they're not present on 5.0 version.

If you download the latest scripting engine, you'll likely get a version
with non-greedy matches implemented.




If you're in the right kind of situation, you can use a negative character
match to achieve the same effect combined with a backreference.

// Liorean




More information about the thelist mailing list