/** * [Parameter str] * @Type {var String} * return 30 */ var str = "ren民BI30kuai" console.log(str.replace(/[^0-9]/ig,""));