Filtering of the email address

xiaoxiao2021-03-06  103

<% '------------------- Email Judgment ----------------- Function IsValidemail (email) DIM Names, Name , I, C'check for Valid Syntax in An Email Address.

IsValidEmail = truenames = Split (email, "@") if UBound (names) <> 1 then IsValidEmail = false exit functionend iffor 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 ifxTIF INSTR (Names (1),". ") <= 0 Then isvalidemail = false exit functionend IFI = Len (Names (1)) - INSTRREV (Names (1), ".") IF i <> 2 and i <> 3 dam isvalidemail = false exit functionend ifif inStr (email, "..")> 0 damsValidemail = Falsend IF

end function%> email address is determined by the legitimacy vbscript <% Function isemail (strng) isemail = falseDim regEx, Match 'Create variables.Set regEx = New RegExp' Create a regular expression object (stupid, huh?) regEx.Pattern = "^ / W (((- / w ) | (/./ w )) * / @ [A-ZA-Z0-9] (/. | -) [A-ZA-Z0-9] ) * /.[A-ZA-Z0-9] $ "'sets pattern.regex.ignorecase = true' set case insensitivity.set match = regex.execute (strng) 'execute search.if match.count dam = trueend function %>

转载请注明原文地址:https://www.9cbs.com/read-104262.html

New Post(0)