Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Some regexp inside ExtendScript freeze InDesign

$
0
0

Hello everybody!

 

I am verifying that some particular regexp freezes InDesign when executed inside ExtenScript.

 

For example:

 

     if (m = line.match(/^sort\s+((?:a(?:lphabetically)?|n(?:umerically)?)|r(?:everse)?){1,2}$/i)) { ...


(meaning that my parser accept lines in one of these forms:


     sort alphabetically reverse

     sort numerically

     sort ar

     sort reverse numerically


and so on...).

 

Another example.

If I use this, everything is working:

 

     m = line.match(/corner\s+((?:\+|\-)?\d+)(?:\s|$)/);


but, if I add the bolded part \d*\.?:

 

     m = line.match(/corner\s+((?:\+|\-)?\d*\.?\d+)(?:\s|$)/);

 

when executing, InDesign freezes.

 

 

What do you think? Maybe ExtendScript contains some bug on the regexp engine? Am I wrong somewhere and I am not able to understand where? :-(

 

Do you experiment the same failure than me when you execute all that?

I am working on Indesign CS6, CC, CC 2014.

 

 

Many thanks ...

 

 

Roberto



Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>