日期:2014-05-17  浏览次数:20866 次

为什么这个简单调用函数的asp程序,运行错误?
<%
Function   RegExpTest(patrn,   strng)
    Dim   regEx,Match,Matches                   '   建立变量。
    Set   regEx   =   New   RegExp                   '   建立正则表达式。
    regEx.Pattern   =   patrn                   '   设置模式。
    regEx.IgnoreCase   =   True                   '   设置不区分大小写。
    regEx.Global=True                                                           '   设置全局可用性
    set   matches=regExExecute(string)                           '   执行搜索。
    for   each   match   in   matches                                           '   重复匹配集合
    RetStr=RetStr   & "Match   found   at   position   "
    RetStr=RetStr&Match.FirstIndex& ".Match   Value   is   ' "
    RetStr=RetStr&Match.Value& " '. "&vbCRLF  
    Next
    RegExpTest=RetStr
End   Function
MsgBox(RegExpTest( "is. ",   "IS1   is2   IS3   is4 "))
%>
我就是直接把上面的存为一个asp文件执行出错的。

------解决方案--------------------
server端不能msgbox()
------解决方案--------------------
MsgBox(RegExpTest( "is. ", "IS1 is2 IS3 is4 "))

----

MsgBox()函数 在服务器端是没有权限执行的
------解决方案--------------------
用response.write
呵呵,msgbox
最近用javascript用疯了,好像比较遥远了