If you're interested in the details of differences between the various engines for regular expressions, I really recommend Jeffrey Friedl's Mastering Regular Expressions. That other website also has other stuff I see and is not only centered about the book. I guess that on the Tools, Utilities and Programming Languages page there is a comparison somewhere.
Update: I fell for a slight variation in the URL - http://regex.info/, Jeffrey Friedl's site is about the book which I recommend, while http://regexp.info is some more generic regular expression site.
| [reply] |
That site as well as the Sun page has some interesting information, but it's still fairly incomplete. According to regexp.info, Javascript only supports /gim modifiers, but there's no mention of most other features.
What actually started this quest was me wondering if the \Q \E method of escaping was supported. I doubt it is, but it'd be nice to know for sure.
| [reply] |
My untested assumption is that JavaScript inherits it's RegEx behaviour from the Java API. The documentation for the java.util.regex.Pattern class includes a section that describes the differences from Perl 5. This may be of help. | [reply] |
I don't think that's right, because Javascript had regular expressions as of version 1.2, which I believe came out in 1999, whereas Java did not have an official Regexp API until J2SE 1.4 which came out in 2002. So I believe JS took its cue directly from Perl. This document from Sun seems to be a definitive reference.
Update: One other hint is the fact that Javascript uses an identical syntax to Perl for specifying literal regexps (//) and modifiers, but Java does everything through objects.
| [reply] |
| [reply] |