Regular expressions unpredictable and weird
I am really struggling with running regular expressions in Adobe Scripts. They don't seem to have work as they should. I am constantly having to break down complex expressions to simple ones to find things that appear to be bugs in the syntax.
For example:
var pattern = /(A(.+)C)*/g;
var string = "ABBC";
$.writeln(pattern.exec(string));
I should get the result:
"ABBC",
"ABBC",
"BB"
but instead I get:
undefined,
undefined,
"BBC"
What is going on here?
