var str = "1200[44_x][44_x]"
document.write(str.replace(/44/g, "132"))
</script>
我直接把44的3倍乘出来结果放进去了,没必要多写一句44*3
var str = 'anchdkgdnksaf$$ fdksafnas $$dsabfuhasdfhuas$$ anfsadbfjasffnsafhnu $$fdasfasdfas'
var reg = new RegExp('(\\$\\$[^\\$\\$]*\\$\\$)','g')
var i = 0
str = str.replace(reg,function() {
return '{'+ i++ +'}'
})
console.log(str)
// anchdkgdnksaf{0}dsabfuhasdfhuas{1}fdasfasdfas