Regular Expression bug: characters in a positive character group must redundantly be escaped
I've been struggling with the Regular Expression implementation of ExtendScript quite a bit, because it doesn't parse Regular Expressions correctly.
The following information may be helpful to others:
The ExtendScript Regular Expression parser fails to correctly parse positive character groups (characters enclosed in square brackets). Quantifiers and the dot (".") don't make sense in a positive character group, so characters representing these quantifiers are not escaped in positive character groups. However, for the ExtendScript Regular Expression parser to interpret positive character groups, you MUST escape those characters.
For example:
A valid Regular Expression like this:
/[?.*]/
… must be written like this in ExtendScript:
/[\?\.\*]/
… for the ExtendScript Regular Expression parser to accept the Regular Expression.
