var s = "1001|386|||sdf|sdfsdf;1002|386|||sdfsf|sdfsf;";
var re = new RegExp("|386|||","g");
s = s.replace(re, "|386|ULP874094|Pepde 874094|");
alert(s);
怎么得到结果不对啊,我就是要把所有的|386|||替换成|386|ULP874094|Pepde 874094|,怎么写呢
用正则表达式替换实现,怎么写啊,搞了好久了,都没搞出来
new RegExp("\|386\|\|\|", "g")试试