Another regex solution:
string.replace(/\D/g,''); //remove the non-Numeric
Similarly, you can
string.replace(/\W/g,''); //remove the non-alphaNumeric
In RegEX, the symbol '\' would make the letter following it a template: \w -- alphanumeric, and \W - Non-AlphaNumeric, negates when you capitalize the letter.