87,914
社区成员
发帖
与我相关
我的任务
分享
var str = 'http://xxxx.xxxx.com/XX/XXXxxx.xxxx?id=XXX11111&lng=cn&e=fasong http://xxxx.xxxx.com/XX/XXXxxx.xxxx?aa=1&id=XXX11111&lng=cn&e=fasong';
var reg= /(http:\/\/)([^/]+)(\/[^\?]+\?id=XXX11111|[^&]+&id=XXX11111)/gi;
str.replace(reg,function(v,v1,v2,v3){
return v1+'www.baidu.com' + v3;
})