最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
email正则表达式函数
时间:2022-06-30 10:51:23 编辑:袖梨 来源:一聚教程网
email正则表达式函数,是用来判断EMAIL是否正确,从而更好的给用户发邮件,通知等情况
Function IsValidEmail(email)
Dim names, Name, i, c
IsValidEmail = true
names = Split(email, "@")
If UBound(names) <> 1 Then
IsValidEmail = false
Exit Function
End If
For Each Name in names
If Len(Name) <= 0 Then
IsValidEmail = false
Exit Function
End If
For i = 1 To Len(Name)
c = LCase(Mid(Name, i, 1))
If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) Then
IsValidEmail = false
Exit Function
End If
Next
If Left(Name, 1) = "." Or Right(Name, 1) = "." Then
IsValidEmail = false
Exit Function
End If
Next
If InStr(names(1), ".") <= 0 Then
IsValidEmail = false
Exit Function
End If
i = Len(names(1)) - InStrRev(names(1), ".")
If i <> 2 And i <> 3 Then
IsValidEmail = false
Exit Function
End If
If InStr(email, "..") > 0 Then
IsValidEmail = false
End If
End Function
相关文章
- 原神欧洛伦怎么培养 原神欧洛伦培养攻略介绍 11-22
- 炉石传说跳费大哥德卡组怎么样 炉石传说跳费大哥德卡组推荐介绍 11-22
- 蛋仔派对曙光龙女芙瑞怎么样 11-22
- 原神恰斯卡怎么养成 11-22
- 光遇11.22免费魔法有什么 11-22
- 光遇11.22大蜡烛在哪里 11-22