asp中如何调用vbscript方法 20

<scriptlanguage=vbscript>FunctionRegExpTest(patrn,strng)DimregEx,match,Matches'创建变量。S... <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()方法
%>
展开
 我来答
liu_binq63
2006-11-21 · TA获得超过1485个赞
知道大有可为答主
回答量:1881
采纳率:0%
帮助的人:2246万
展开全部
这样就可以了。
<%
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

%>
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
一碑电影
2006-11-21 · 知道合伙人影视综艺行家
一碑电影
知道合伙人影视综艺行家
采纳数:406 获赞数:5429
微信公众号:一碑电影。 电影,延长三倍人生。

向TA提问 私信TA
展开全部
call RegExpTest("is.", "Is1 iS2 is3 ")
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
应用之美
2006-11-21 · TA获得超过2513个赞
知道小有建树答主
回答量:453
采纳率:0%
帮助的人:377万
展开全部
call RegExpTest
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式