javascript如何使用replace替换?
巴扎黑
巴扎黑 2017-05-19 10:35:44
0
1
428
雷雷
巴扎黑
巴扎黑

全部回复(1)
Peter_Zhu

不要匹配开始^和匹配末尾$

function replacer(word) {
    return 'hello';
}
var newString = 'abc[你好]de[他]fg'.replace(/\[[^\u0000-\u00FF]{1,2}\]/gi, replacer);
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板