欢迎来到福编程网,本站提供各种互联网专业知识!

正则表达式简单的检查输入email是否合法程序

发布时间:2007-04-06 作者: 来源:转载
functionchkEmail(email)onerrorresumenextdimi,l,pos1,pos2chkEmail=trueifisnull(email)thenchkEmail=false:exitfunctionpos1=instr(email,"@")pos2=instrRev(email,".")ifnot(pos1>0)ornot(pos2>0)orpos1>pos2thenchkEmail=falseendififerr.number0the
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

相关推荐