The most common verification is email address verification. Websites are common. Various web scripts also use regular expressions "(Regular Expression) Verify the email address we entered to determine whether the email address is valid. Some can also separate the username and domain name. Use nowJavascriptThe language implements email address verification.Program, Which isJavascriptThe Regular Expression Library of the language.
Source codeThe web page has been verified on IE, Firefox, and chrome as follows:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < Html Xmlns = "Http://www.w3.org/1999/xhtml" Lang = "ZH" XML: Lang = "ZH" > < Head > < Meta HTTP-equiv = "Content-Type" Content = "Text/html; charsets = UTF-8" /> < Title > Email address verification procedure </ Title > < Script Language = "JavaScript" Type = "Text/JavaScript" > // <! [CDATA [ Function Check (email_address ){ VaR RegEx = / ^ ([0-9a-za-z \-_ \.] +) @ ([0-9a-z] + \. [A-Z] {2, 3 }(\. [A-Z] {2 })?) $ / G; If (RegEx. Test (email_address )){ VaR User_name = Email_address.replace (RegEx, " $1 " ); VaR Domain_name = Email_address.replace (RegEx, " $2 " ); VaR Alert_string = " The email address you entered is valid \ n " ; Alert_string + = " User name: " + User_name + " \ N " ; Alert_string + = " Domain Name: " + Domain_name; window. Alert (alert_string ); Return True ;} Else {Window. Alert ( " The email address you entered is invalid. " ); Return False ;}} // ]> </ Script > </ Head > < Body Style = "Text-align: center ;" > < H1 > Email address verification procedure </ H1 > Enter the email address: < Input ID = "Email_address" Type = "Text" Style = "Width: 300px ;" /> < BR /> < Input Type = "Button" Value = "Verify email address" Onclick = "Return check (document. getelementbyid ('email _ address'). Value );" /> </ Body > </ Html >