Did you try your regex example? It doesn't do what the OP asked for. He wants only the numbers 0-9 extracted from his string. Yours removes a-z, but leaves anything that isn't a-z, which includes commas, periods, and all other punctuation and non-printing characters. qwerty's regex uses the built-in \D which is equivalent to [^0-9] (match anything that isn't (^) a number (0-9) ).
(Also, the g means global. In that the regex searches repeatedly, starting at the end of the last match, trying to find as many matches as possible before the end of the string.)
-genius_at_work