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 nowPHPThe language implements email address verification.Program, Which isPHPRegular Expression Library.
Source codeAs follows:
<? PHP Header ("Content-Type: text/html; charset = UTF-8" ); $ Reply = "" ; If ( Isset ($ _ Post ["Email_address" ]) { $ Email_address = $ _ Post ["Email_address" ]; $ Pattern = "/^ ([0-9a-za-z \-_ \.] +) @ ([0-9a-z] + \\. [A-Z] {2, 3 }(\\. [A-Z] {2 })?) $/I" ; If ( Preg_match ( $ Pattern , $ Email_address )){ $ Reply = "The email address you entered is valid <br/> \ n" ; $ User_name = Preg_replace ( $ Pattern , "$1 ", $ Email_address ); $ Domain_name = Preg_replace ( $ Pattern , "$2 ", $ Email_address ); $ Reply . = "User name :". $ User_name . "<Br/> \ n" ; $ Reply . = "Domain Name :". $ Domain_name . "<Br/> \ n" ;} Else { $ Reply = "The email address you entered is invalid" ;}} ?> <! 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 > < Title > Email address verification procedure</ Title > </ Head > < Body Style = "Text-align: center ;" > < H1 > Email address verification procedure </ H1 > < Form Action = "#" Method = "Post" > Enter the email address: < Input Name = "Email_address" Type = "Text" Style = "Width: 300px ;" /> < BR /> < Input Type = "Submit" Value = "Verify email address" /> </ Form > <? PHP Echo $ Reply ; ?> </ Body > </ Html >