判断输入的Email地址格式是否正确
请问:我想判断从文本框中输入的Email地址格式是否正确应该怎么实现?
使用正则
<%
Function isemail(strng)
isemail = false
Dim regEx,Match
Set regEx = New RegExp
RegEx.Pattern = "^\w+((-\w+)|(.\w+))*@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$"
RegEx.IgnoreCase = True
Set Match = RegEx.Execute(strng)
if match.count then isemail = true
End Function
if not isemail(Email) then
response.write "Email格式不对,请重新输入!"
end if
%>