明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺!

用vbscript判斷email地址的合法性

[摘要]這里是一斷正則表達式的例子<%Function isemail(strng) isemail = false Dim regEx, Match ' Create variables. Set regEx = New RegExp ' Create a r...
這里是一斷正則表達式的例子
<%
Function isemail(strng)
    isemail = false
    Dim regEx, Match ' Create variables.
    Set regEx = New RegExp   ' Create a regular expression object (stupid, huh?)
    regEx.Pattern = "^\w+((-\w+) (\.\w+))*\@[A-Za-z0-9]+((\. -)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$" ' Sets pattern.
    regEx.IgnoreCase = True   ' Set case insensitivity.
    Set Match = regEx.Execute(strng)   ' Execute search.
if match.count then isemail= true
End Function
%>