Quantcast
Channel: Adobe Community : Discussion List - Illustrator Scripting
Viewing all articles
Browse latest Browse all 3671

does extend script have an egrep equivalent

$
0
0

Hi there,

 

I write most of my scripts in applescript but occasionally have to port them to Javascript. In my current applescript I'm using the do shell script command to invoke the unix egrep command to convert a string into an array and I wandered if this could be done in a javascript that would work on Mac & Windows?

 

my current script is this:

 

set tf_contents to " 79R

91L"

 

set numbers_list to every paragraph of (do shell script "echo \"" & tf_contents & "\" | egrep \"[0-9]{1,}\" -o")

 

this will return an array like this: {"79", "91"}

 

Many Thanks,

Nik

 


Viewing all articles
Browse latest Browse all 3671

Trending Articles



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