站内搜索

一个验证EMAIL是否合法的函数(VBScript)

<%
function isemail(str)
   if isnull(str) then
      exit function
   end if

   dim regstr,regex
   set regex=New RegExp
   regex.pattern="/w+([-+.]/w+)*@/w+([-.]/w+)*/./w+([-.]/w+)*"
   isemail=regex.test(str)
   set regex=nothing
end function

if not isemail("xfclub@163.com") then
   response.write "不正确的Email"
else
   response.write "正确的Email"
end if
%>

  • 上一篇:一个验证用户名是否包含非法字符的函数(VBScript)
  • 下一篇:一些初学者常用的ASP代码