A simple E_Mail address judgment function (general)
Source: Internet
Author: User
—————————————————
' | author:i94self |
' | e_mail:i94self@hotmail.com |
' | HTTP://www.I94Self.com |
' | Please save author Information |
' —————————————————
''''''''''''''''''''''''''''''''
' Judge if E_Mail input is correct '
''''''''''''''''''''''''''''''''
Function Isvalide_mail (E_Mail)
' To determine if there is an @ symbol in the E_Mail address, if there is no @ symbol or the @ symbol at the first or last E_Mail character, then the function returns false and the function exits.
E_mailarray=split (E_Mail, "@")
If UBound (e_mailarray) <>1 Then
Isvalide_mail=false
Exit Function
End If
' Determine if there is a link in the E_Mail address. Symbols (including ...) or countless. Connected symbols), and if so, the function returns false and exits the function.
If InStr (E_Mail, "...") >0 Then
Isvalide_mail=false
Exit Function
End If
' Determine if the string in the E_Mail address has a. Character if there is no. symbol OR. The first of the E_Mail characters, the function returns false, and the function exits.
If InStr (E_mailarray (1), ".") <= 0 Then
Isvalide_mail = False
Exit Function
End If
' Judge the E_Mail address. The string after is equal to 2 characters or 3 characters, if not equal, the function returns false and the function exits.
Number=len (E_mailarray (1))-instrrev (E_mailarray (1), ".")
If number<>2 and Number<>3 Then
Isvalide_mail=false
Exit Function
End If
For each e_mailarraycontent in E_mailarray
' Determine if there are any characters before @ in the E_Mail address, and if not, the function returns false and exits the function.
If Len (e_mailarraycontent) <=0 Then
Isvalide_mail=false
Exit Function
End If
' Determine if the E_Mail address contains illegal characters except abcdefghijklmnopqrstuvwxyz_-and numbers, and if so, the function returns false and exits the function.
For Number=1 to Len (e_mailarraycontent)
E_mailstr=lcase (Mid (e_mailarraycontent,number,1))
If InStr ("abcdefghijklmnopqrstuvwxyz_-.", E_mailstr) <=0 and not IsNumeric (E_MAILSTR) Then
Isvalide_mail=false
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.