I wrote a regex command to find and output the first instance of a line of digits in a string:
find: ^[^\d]*(\d+).*
replace: $1
The problem is that in order to actually utilize this in AppleScript, the only way I know of doing this is with calling a shell script and using sed. I can't figure out how to actually use my regex in this way. I've tried for hours without any luck. This is as close as I can get, but it returns ALL the numbers in a string, rather than the first group of numbers:
set num to do shell script "sed 's/[^0-9]*//g' <<< " & quoted form of input
What I would really like is a way to use AppleScript to just WORK with regex and found match replacement ($1, $2, etc).