最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp 邮箱地址验证正则表达式
时间:2022-06-30 10:51:06 编辑:袖梨 来源:一聚教程网
方法一
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
邮箱地址验证一
<%
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
%>
方法三
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
%>
我们来看看验证一的实例使用方法
If ChkMail([email protected]) = True Then
Response.Write "格式正确"
Else
Response.Write "格式有误"
End If
相关文章
- 四海兄弟故乡人物边缘模糊怎么办 人物边缘模糊解决方法 08-21
- 四海兄弟故乡神秘狐狸06怎么找 神秘狐狸06位置介绍 08-21
- 四海兄弟故乡神秘狐狸05怎么找 神秘狐狸05位置说明 08-21
- 诛仙2四海战歌奇遇怎么做 四海战歌东海奇遇收集 08-21
- 四海兄弟故乡神秘狐狸04怎么找 神秘狐狸04位置一览 08-21
- 四海兄弟故乡城市有多少 城市地点背景介绍 08-21