前端js替换所有匹配字符 云博小周宇2024年5月5日2023年8月11日1 Min Read js没有replaceAll,所以用正则表达式查找所有匹配项(”g”), .replace(new RegExp("\\.", "g"), "‘,‘") .在正则中要用\\转义