To be honest, SQL is a poor choice of language to do this: it isn't a text processor, and it's string handling is basic at best.
You can do it:
this[
^] has an example at the bottom which extracts all the digit characters from a string, and you could modify it to do what you want, probably fairly easily.
But... It'll always be a bit dodgy for exactly what you want.
You would be much better off f doing this in a "normal" programming language, preferably one with Regex handling. It's very simple to build a reliable solution in VB or C# for example.