If notEmail(Text1Text) Then
MsgBox "邮箱格式不正确"
Else
MsgBox "邮箱格式正确"
End If
End Sub
Function notEmail(ByVal Email As String) As Boolean
Dim regEx
Set regEx = CreateObject("VBScriptRegExp")
regExIgnoreCase = True
regExPattern = "^[a-z]([a-z0-9][-_][a-z0-9]+)@([a-z0-9][-_][a-z0-9]+)+[\][a-z]{2,3}([\][a-z]{2})$"
notEmail = IIf(regExTest(Email), False, True)
Set regEx = Nothing
End Function
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)