asp 正则替换函数

mac2022-06-30  78

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")'(正则表达式 要拿来替换的,原字符串,替换成的字符)

转载于:https://www.cnblogs.com/alex-13/p/3840049.html

相关资源:asp下替换非数字为空的正则
最新回复(0)