const str = '100000000000000'
const reg = /(?=(\d{3})+$)/g
console.log(str.replace(reg, '.')) // .100.000.000.000.000
const str = '100000000000000'
const reg = /(?=(\B)(\d{3})+$)/g
console.log(str.replace(reg, '.')) // 100.000.000.000.000
网友评论