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