Grep wildcard: force numbers..

Ok, I know this isn’t a real AppleScript question but rather a UNIX question and yes I checked “man grep”
What I want to do is, I have this string and I want to get a certain piece out of it, ie. “TestS01E01Test” → S01E01 you see ?
so something like SE the wildcards need to be a number! not “.” because “.” can be a letter too

set theString to "TestS01E01Test"
set theString to do shell script "echo " & quoted form of theString & " | /usr/bin/grep -o 'S^[0-9]E^[0-9]*'"
--> the non-zero error (no result)

Anyone knows how to use it as a wildcard correctly ?

Note that “text 5 thru 11 of theString” won’t do the trick because “Test” can have whatever length…

Thanks

How about this?


set theString to "TestS01E01Test"
set theString to do shell script "echo " & quoted form of theString & " | /usr/bin/grep -o -E 'S[0-9]*E[0-9]*'"

Thanks !
Once I tried “S^[0-9]E[0-9]” -so close… I didn’t know that I could leave out the “^”