正则表达式简单的检查输入email是否合法程序
- 作者: 冷心33072806
- 来源: 51数据库
- 2021-09-01
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.number<>0 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.number<>0 then err.clear
end function
推荐阅读