<script language=vbscript>Function RegExpTest(patrn, strng)Dim regEx, match, Matches ' 创建变量。Set regEx = New RegExp ' 创建正则表达式。regEx.Pattern = patrn ' 设置模式。regEx.IgnoreCase = false ' 设置为不区分大小写。regEx.Global = True ' 设置全局适用。Set Matches = regEx.Execute(strng) ' 执行搜索。For Each Match in Matches ' 对 Matches 集合进行迭代。RetStr = RetStr & "Match found at position "RetStr_1 = RetStr & Match.FirstIndex & ". Match Value is '"RetStr_2 = RetStr & Match.Value & "'." & vbCRLFNextRegExpTest = RetStrEnd FunctionMsgBox(RegExpTest("is.", "Is1 iS2 is3 "))</script><%我在这里如何调用RegExpTest()方法%>
添加回答
举报
0/150
提交
取消