asp中如何调用vbscript方法

<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 & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "Is1 iS2 is3 "))
</script>

<%
我在这里如何调用RegExpTest()方法
%>

第1个回答  2006-11-21
这样就可以了。
<%
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 & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function

%>本回答被网友采纳
第2个回答  2006-11-21
call RegExpTest("is.", "Is1 iS2 is3 ")
第3个回答  2006-11-21
call RegExpTest
相似回答