把字符串中匹配到的所有'A'替换成'哈'
<script>
var text = 'A12A34A56A789A'
var result = text.replace(new RegExp('A', 'g'), '哈')
console.log(result)//哈12哈34哈56哈789哈
</script>
把字符串中匹配到的所有'A'替换成'哈'
<script>
var text = 'A12A34A56A789A'
var result = text.replace(new RegExp('A', 'g'), '哈')
console.log(result)//哈12哈34哈56哈789哈
</script>