正则表达式简单的检查输入email是否合法程序
发布时间:2016-12-29 来源:查字典编辑
摘要:functionchkEmail(email)onerrorresumenextdimi,l,pos1,pos2chkEmail=truei...
functionchkEmail(email)
onerrorresumenext
dimi,l,pos1,pos2
chkEmail=true
ifisnull(email)thenchkEmail=false:exitfunction
pos1=instr(email,"@")
pos2=instrRev(email,".")
ifnot(pos1>0)ornot(pos2>0)orpos1>pos2then
chkEmail=false
endif
iferr.number<>0thenerr.clear
endfunction