What's wrong with my grep command ?

Hi

This is my command, it works if the number is in front of the name but not after it…

do shell script "echo " & quoted form of "13SomeName" & " | /usr/bin/grep -o '[0-9]*'"

but this doesn’t work

do shell script "echo " & quoted form of "SomeName13" & " | /usr/bin/grep -o '[0-9]*'"

The number has to be the first digit with my script…

Am I missing something with the wildcard?

Thanks

Try setting the character range and removing the wildcard

set x to do shell script "echo " & quoted form of "13SomeName" & " | /usr/bin/grep -o -E '[0-9]{1,2}'"

Format for the range is {min,max}

Thanks alot! it worked like a charm :smiley: