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