1 Reply Latest reply on May 22, 2013 10:15 AM by dln385

    RegEx Lazy mode bug in CS5

    Marco Lugli

      Hello, it seems that sometimes, lazy mode regex doesn't work in CS5.

       

      Following this discussion: http://forums.adobe.com/message/4007138

       

      I would like to understand how can I create a regex code for the following cases:


      1

      0,1

      0,10

      0,100

      1,0

      10,0

      100,0

      1.000,00

      10.000,00

      100.000,00 

       

      My first approach was the following:  ((\d+)?(\.?))+(\d{1,3})(,(\d+))? 

       

      Unfortunately, CS5 doesn't seem to work with this part of the code: (\d+)? 

       

      Is there a way to bypass this limitation?  Thanks in advance

        • 1. Re: RegEx Lazy mode bug in CS5
          dln385 Level 2

          I'm not too sure about the limitations of ExtendScript's implementation of regular expressions, but this regex should work: \d+(\.\d\d\d)*(,\d+)?

           

          If the problem with (\d+)? is the question mark, you could do (\d+){0,1} instead. If my regex has the same problem, you could use \d+(\.\d\d\d)*(,\d+){0,1} instead.