正則表達(dá)式簡(jiǎn)單的檢查輸入email是否合法程序
更新時(shí)間:2007年04月06日 00:00:00 作者:
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
您可能感興趣的文章:
相關(guān)文章
詳解Java判斷是否是整數(shù),小數(shù)或?qū)崝?shù)的正則表達(dá)式
這篇文章主要介紹了詳解Java判斷是否是整數(shù),小數(shù)或?qū)崝?shù)的正則表達(dá)式,非常具有實(shí)用價(jià)值,需要的朋友可以參考下。2016-12-12
數(shù)據(jù)庫(kù)中使用正則表達(dá)式小結(jié)
這篇文章主要介紹了數(shù)據(jù)庫(kù)中使用正則表達(dá)式小結(jié)的相關(guān)資料,需要的朋友可以參考下2015-10-10
javascript正則表達(dá)式容易被忽略的小問題整理
小問題:lastIndex只對(duì)exec()和test()方法起作用,string.match(regexp)是不會(huì)影響regexp這個(gè)正則的lastIndex屬性的,具體祥看本文2013-07-07
javascript中匹配價(jià)格的正則表達(dá)式
價(jià)格的格式應(yīng)該如下,開頭數(shù)字若干位,可能有一個(gè)小數(shù)點(diǎn),小數(shù)點(diǎn)后面可以有兩位數(shù)字。hansir給出的對(duì)應(yīng)正則如下2012-09-09
notepad++ 等用正則表達(dá)式自動(dòng)添加sql引號(hào)的技巧
本篇文章給大家介紹notepad用正則表達(dá)式自動(dòng)添加sql引號(hào)的技巧,,需要的朋友可以參考下2015-10-10

