Function RegExpTest(patrn,str1,strng)
Dim regEx',str1 ' 建立变量
'str1 = "The quick brown fox jumped over the lazy dog."
Set regEx = New RegExp ' 建立正则表达式
regEx.Pattern = patrn ' 设置模式
regEx.IgnoreCase = True ' 设置是否区分大小写
'RegExpTest = regEx.test(strng)' 执行搜索
RegExpTest = regEx.Replace(str1,strng)
End Function
response.write RegExpTest("fox","The quick brown fox jumped over the lazy dog.","IS1 is2 IS3 is4")'(正则表达式 要拿来替换的,原字符串,替换成的字符)

05-11 15:51