asp 正則表達(dá)式檢測(cè)http開頭的函數(shù)
更新時(shí)間:2007年08月08日 12:05:38 作者:
'####################################
'函數(shù):ishttp[str]
'參數(shù):str,待處理的字符串
'作者:木木
'日期:2007/7/12
'描述:檢測(cè)HTTP連接地址或地址欄是否以HTTP開頭
'示例:<%=ishttp(http://www.alixixi.com)%>
'####################################
Function ishttp(str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(http|HTTP)[A-Za-z]{0,1}\:\/\/"
ishttp = regEx.Test(str)
End function
驗(yàn)證郵件地址是否符合標(biāo)準(zhǔn)
<%
'******************************
'函數(shù):isemail(strng)
'參數(shù):strng,待驗(yàn)證的郵件地址
'作者:阿里西西
'日期:2007/7/13
'描述:驗(yàn)證郵件地址是否符合標(biāo)準(zhǔn)
'示例:<%=isemail(ali@alixixi.com)%>
'******************************
Function isemail(strng)
isemail = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then isemail= true
End Function
%>
正則表達(dá)式檢測(cè)中國移動(dòng)電話手機(jī)號(hào)碼'*********************************************************
'函數(shù):mobilecheck[str]
'參數(shù):str,待處理的字符串
'作者:木木
'日期:2007/7/12
'描述:檢測(cè)移動(dòng)電話手機(jī)號(hào)碼
'示例:<%=mobilecheck("13912345678")%>
'*********************************************************
Function mobilecheck(str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(13[4-9]|15(8|9))\d{8}$"
mobilecheck= regEx.Test(str)
End Function
'函數(shù):ishttp[str]
'參數(shù):str,待處理的字符串
'作者:木木
'日期:2007/7/12
'描述:檢測(cè)HTTP連接地址或地址欄是否以HTTP開頭
'示例:<%=ishttp(http://www.alixixi.com)%>
'####################################
Function ishttp(str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(http|HTTP)[A-Za-z]{0,1}\:\/\/"
ishttp = regEx.Test(str)
End function
驗(yàn)證郵件地址是否符合標(biāo)準(zhǔn)
<%
'******************************
'函數(shù):isemail(strng)
'參數(shù):strng,待驗(yàn)證的郵件地址
'作者:阿里西西
'日期:2007/7/13
'描述:驗(yàn)證郵件地址是否符合標(biāo)準(zhǔn)
'示例:<%=isemail(ali@alixixi.com)%>
'******************************
Function isemail(strng)
isemail = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then isemail= true
End Function
%>
正則表達(dá)式檢測(cè)中國移動(dòng)電話手機(jī)號(hào)碼'*********************************************************
'函數(shù):mobilecheck[str]
'參數(shù):str,待處理的字符串
'作者:木木
'日期:2007/7/12
'描述:檢測(cè)移動(dòng)電話手機(jī)號(hào)碼
'示例:<%=mobilecheck("13912345678")%>
'*********************************************************
Function mobilecheck(str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = "^(13[4-9]|15(8|9))\d{8}$"
mobilecheck= regEx.Test(str)
End Function
相關(guān)文章
JavaScript中的正則表達(dá)式使用及驗(yàn)證qq號(hào)碼的正則
這篇文章給大家介紹了javascript中的正則表達(dá)式使用及驗(yàn)證qq號(hào)碼的正則表達(dá)式,涉及到手機(jī)號(hào)、姓名、qq相關(guān)知識(shí)驗(yàn)證,感興趣的朋友一起學(xué)習(xí)吧2015-11-11
淺析lastIndex對(duì)正則表達(dá)式結(jié)果的影響
js中正則表達(dá)式的使用方式有兩種,一種是正則表達(dá)式對(duì)象的方法,一種是字符串對(duì)象的方法。下面通過本文給大家分享lastIndex對(duì)正則表達(dá)式結(jié)果的影響,需要的朋友參考下吧2017-11-11
經(jīng)典Javascript正則表達(dá)式[優(yōu)質(zhì)排版]
正則表達(dá)式用于字符串處理,表單驗(yàn)證等場(chǎng)合,實(shí)用高效,但用到時(shí)總是不太把握,以致往往要上網(wǎng)查一番。我將一些常用的表達(dá)式收藏在這里,作備忘之用2013-01-01
Jmeter?使用Json提取請(qǐng)求數(shù)據(jù)的方法
這篇文章主要介紹了Jmeter?使用Json提取請(qǐng)求數(shù)據(jù),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-04-04
JavaScript正則表達(dá)式校驗(yàn)非負(fù)整數(shù)實(shí)例
本文分享了JavaScript正則表達(dá)式(^\d+$ 或 ^[1-9]\d*|0$)校驗(yàn)非負(fù)整數(shù)實(shí)例代碼,代碼簡單易懂,需要的朋友可以看下2016-12-12

