- 匹配所有数字
const str = '地方123.4合规ss8'
const result = str.replace(/\D/g, '')
console.log(result) //12348
- 匹配带小数的正负数
const str = '地方-123.4合规ss8.12'
const result = str.replace(/[^-\d.]/g, '').split('.').slice(0,2).join('.')
console.log(result) //-123.48