I just want to match some text in a Bash script. I\'ve tried using sed but I can\'t seem to make it just output the match instead of replacing it with something.
Pure Bash. Use parameter substitution (no external processes and pipes):
string="TestT100String" echo ${string//[^[:digit:]]/}
Removes all non-digits.