Asingkan setiap tiga aksara dengan koma
Kaedah biasa:
"115000000".split("").reverse().join("").replace(/(d{3})(?=[^$])/g, "$1,").split ("").reverse().join("");
var str = '123123211312.333123'.replace(/(?=(?!^)(?:d{3}) (?:.|$))(d{3}(.d $)?)/ g,',$1');
console.log(str)
'1500000000000'.ganti(/B(?=(d{3}) $)/g,',')
Kaedah carian gelung