Quantcast
Channel: Adobe Community : Unanswered Discussions - General and cross-application scripting
Viewing all articles
Browse latest Browse all 84

Bug in ExtendScript's regular expression engine

$
0
0

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!


Viewing all articles
Browse latest Browse all 84

Trending Articles