濮阳杆衣贸易有限公司

主頁 > 知識庫 > asp email郵箱地址驗證正則表達式

asp email郵箱地址驗證正則表達式

熱門標(biāo)簽:上海銷售電銷機器人軟件 山東外呼系統(tǒng)聯(lián)系方式 自己做的電銷機器人 惠安地圖標(biāo)注 地圖標(biāo)注店鋪地圖標(biāo)注酒店 浙江營銷外呼系統(tǒng)有哪些 淄博市張店區(qū)地圖標(biāo)注 遼寧秒客來電話機器人 哈爾濱公司外呼系統(tǒng)代理

上篇文章我們用字符串查找的方法實現(xiàn)了asp email郵箱地址的驗證,有可能比較喜歡正則表達式的朋友,這里也給出相應(yīng)的代碼。
方法一

復(fù)制代碼 代碼如下:

Public Function ChkMail(ByVal Email)
Dim Rep,Pmail : ChkMail = True : Set Rep = New RegExp
Rep.Pattern = "([.a-zA-Z0-9_-]){2,10}@([a-zA-Z0-9_-]){2,10}(.([a-zA-Z0-9]){2,}){1,4}$"
Pmail = Rep.Test(Email) : Set Rep = Nothing
If Not Pmail Then ChkMail = False
End Function

郵箱地址驗證二
復(fù)制代碼 代碼如下:

%
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
%>

方法三
復(fù)制代碼 代碼如下:

Public Function IsEmail(ByVal PString)
Dim Plt,Pgt : Plt = False : Pgt = False
For x = 2 To Len(PString) - 1
If Mid(PString,x,1) = "@" Then Plt = True
If Mid(PString,x,1) = "." And Plt = True Then Pgt = True
Next
If Plt = True And Pgt = True Then
IsEmail = True
Else
IsEmail = False
End if
End Function
%>

我們來看看驗證一的實例使用方法
復(fù)制代碼 代碼如下:

If ChkMail(admin@jb51.net) = True Then
Response.Write "格式正確"
Else
Response.Write "格式有誤"
End If

您可能感興趣的文章:
  • JS 日期驗證正則附asp日期格式化函數(shù)
  • asp 驗證輸入網(wǎng)址是否有效并可以訪問 與正則驗證輸入網(wǎng)址
  • asp 圖片正則 替換,替換前檢查圖片是不是本地地址的方法
  • 在ASP中用正則表達式對象來校驗數(shù)據(jù)的合法性

標(biāo)簽:綿陽 西安 長沙 無錫 泰州 銅川 重慶 宣城

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp email郵箱地址驗證正則表達式》,本文關(guān)鍵詞  asp,email,郵箱,地址,驗證,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp email郵箱地址驗證正則表達式》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp email郵箱地址驗證正則表達式的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    额济纳旗| 安吉县| 盐边县| 永济市| 专栏| 页游| 连南| 彰化县| 新营市| 珲春市| 兴海县| 天柱县| 庆云县| 大庆市| 西丰县| 特克斯县| 平和县| 大兴区| 咸丰县| 肥城市| 金沙县| 洪洞县| 宁陕县| 静海县| 达拉特旗| 南陵县| 青阳县| 汨罗市| 炎陵县| 泌阳县| 托克托县| 维西| 南阳市| 珲春市| 边坝县| 洱源县| 襄城县| 白朗县| 东阿县| 金昌市| 兰西县|