in reply to Slightly Off Topic: Differences with Regular Expressions in other languages

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.
  • Comment on Re: Slightly Off Topic: Differences with Regular Expressions in other languages

Replies are listed 'Best First'.
Re^2: Slightly Off Topic: Differences with Regular Expressions in other languages
by Errto (Vicar) on Jan 09, 2006 at 14:40 UTC

    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.