The following regular expression will match for a single character not present in the range between 0 (ASCII 48) and 9 (ASCII 57) (case sensitive).
Meaning it will convert from Test123 to Test.
myString = myString.replace(/[^0-9]/g, '');
Code language: JavaScript (javascript)
trilok
myString = myString.replace(/[^0-9]/g, '');