<script>
function replacer(word) {
return 'hello';
}
var newString = 'abc[你好]de[他]fg'.replace(/^\[[^\u0000-\u00FF]{1,2}\]$/gi, replacer);
alert(newString)//todo:为什么这里显示的不是hellohello,我想把[你好][他]替换成hello
</script>
largeQ
相关分类