2 Replies Latest reply on Jun 4, 2012 8:03 PM by xbytor2

    Bug in ExtendScript regular expressions

    AdrianBentley Level 1

      I don't know if this is a problem with javascript in general or photoshop's hosting of it.  The bug reporting area looks dicey so I'm posting it here too.

       

      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.

       

      Thanks,

      Adrian