var reg = /[1-9][0-9]*/g
var reg = /[1-9][0-9]*/g
var str = '30kg/件'
var num = str.match(reg)[0]
console.log(num) ===>控制台打印结果为: 30
var reg = /[1-9][0-9]*/g
var reg = /[1-9][0-9]*/g
var str = '30kg/件'
var num = str.match(reg)[0]
console.log(num) ===>控制台打印结果为: 30