Skip navigation
Currently Being Moderated

Bug in ExtendScript's regular expression engine

Jul 1, 2010 9:33 PM

I'm using ExtendScript 3.92.115, and I'm noticing that a certain regular expressions don't work properly.  I've tried the same expressions on popular browsers, and they work fine.  Here's an example:

 

alert('ab'.match(/(.)(?:.*?)$/));

 

The alert should display the array: ["ab", "a"], because there is a match ("ab"), and one capturing group ("(.)" captures "a").  Instead it displays ["ab", undefined], which makes no sense.  It works fine if both groups are capturing: "(.)(.*?)$", if you remove the non-greedy modifier: "(.)(?:.*)$", or even if you don't group the second part: "(.).*?$".

 

Any thoughts?  I can modify my regular expressions to work around these problems, but it'd be good to fix the engine if it's really broken, as I suspect.

 

Thanks!

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points