JS正则表达式提取数字

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