+ -
当前位置:首页 → 问答吧 → 如何用正则实现字符串替换问题

如何用正则实现字符串替换问题

时间:2011-11-21

来源:互联网

如何将“http://xxxx.58886.com/”替换为“http://bj.58886.com/”?其中“xxxx”为任意字符 ,如何用正则实现字符串替换?

作者: wyxk2003   发布时间: 2011-11-21

VBScript code

<%
s = "http://xxxx.58886.com/ xxxx http://sdadasd.58886.com/ xxxx http://sdadd.58886.com/"
Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.Pattern = "http\:\/\/[^\.]+\.58886\.com\/"
s = re.Replace(s, "http://bj.58886.com/")
Response.Write s
%>

作者: hookee   发布时间: 2011-11-21