方法二:找到匹配的进行替换
ip="127.0.0.1" Function ReplaceTest(str,patrn, replStr) Dim regEx, str1 Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True ReplaceTest = regEx.Replace(str, replStr) End Function response.write(ReplaceTest(ip,"d+", "cat"))
资料参考:
asp正则表达式常用方法 http://webcenter.hit.edu.cn/articles/2010/06-06/06173737.htm