This expression: "a_bs".match(/^\s*(A)(?:_B|_BS)?\s*$/i)
Evaluates to: a_bs,
That is it fails to report the grouped (a) up there. Obviously I'm using it in a more complex manner (a bunch of |s inside the first group).
The following works as I'd expect.
This expression: "a_bs".match(/^\s*((A)(?:_B|_BS)?)\s*$/i)
Evaluates to: a_bs,a_bs,a
It DOES pick up the a in its group. Both ruby and python agree with me. If anyone from Adobe is listening, please fix it.
Yes it does look like a bug, it works fine in Photoshop CS3 and CS4 but bust in CS5 and CS6.
Each rev fixes some RegExp bugs and introduces new ones. It's tedious but do report your bugs at adobe.com. The have fixed some of mine.
Also, sometimes ESTK and PS have different bugs.