var str = "sss3324ere"; var numStr = str.replace(/\D/g, ""); //var numStr = str.match(/\d/g).join(""); alert(numStr)