var nos="01-23 45: 67 89 "; alert(nos.replace(/\D+/g,''));