当前位置: 编程技术>其它
正则表达式简单的检查输入email是否合法程序
来源: 互联网 发布时间:2014-10-14
本文导语: function chkEmail(email) on error resume next dim i,l,pos1,pos2 chkEmail=true if isnull(email) then chkEmail=false:exit function pos1= instr(email,"@") pos2=instrRev(email,".") if not(pos1>0) or not (pos2>0) or pos1>pos2 then chkEmail=false end if if err.number0 then err....
function chkEmail(email)
on error resume next
dim i,l,pos1,pos2
chkEmail=true
if isnull(email) then chkEmail=false:exit function
pos1= instr(email,"@")
pos2=instrRev(email,".")
if not(pos1>0) or not (pos2>0) or pos1>pos2 then
chkEmail=false
end if
if err.number0 then err.clear
end function
on error resume next
dim i,l,pos1,pos2
chkEmail=true
if isnull(email) then chkEmail=false:exit function
pos1= instr(email,"@")
pos2=instrRev(email,".")
if not(pos1>0) or not (pos2>0) or pos1>pos2 then
chkEmail=false
end if
if err.number0 then err.clear
end function