There are many ways to verify your email address. On the browser side, JS mailbox verification can be detected through regular expressions.
Like what:
Copy CodeThe code is as follows:
function Isemail (email) {
Return/^ ((([a-z]|\d|[! #\$%& ' \*\+\-\/=\?\^_ ' {\|} ~]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) +(\. ([a-z]|\d| [!#\$%& ' \*\+\-\/=\?\^_ ' {\|} ~]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) +)*)| ((\x22) ((((\x20|\x09) * (\x0d\x0a))? ( \x20|\x09) +)? ([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21| [\x23-\x5b]| [\x5d-\x7e]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) | (\ \ ([\x01-\x09\x0b\x0c\x0d-\x7f]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]))) * (((\x20|\x09) * (\x0d\x0a))? (\x20|\x09) +)? (\x22))) @ (([a-z]|\d| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) | ([a-z]|\d| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) ([a-z]|\d|-|\.| _|~| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) * ([a-z]|\d| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]))) \.) + ([a-z]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) | ([a-z]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) ([a-z]|\d|-|\.| _|~| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]) * ([a-z]| [\U00A0-\UD7FF\UF900-\UFDCF\UFDF0-\UFFEF]))) $/i.test (email);
}
The call is simple:
Copy the Code code as follows:
if (Isemail (' youremail@yourdomain.com ')) {Console.log (' This is e-mail is valid ');}
If you are doing server-side validation. Like PHP, the simplest is:
Copy the Code code as follows:
/*
* Email address legality verification
*/
function Isemail ($mail _address) {
Return Filter_var ($mail _address, filter_validate_email);
}
But the whole thing can be complicated.
Like this. He established a complete set of email address verification website system. It is estimated that few people do this.
To tell the truth, I have to admire.
http://www.bkjia.com/PHPjc/676860.html www.bkjia.com true http://www.bkjia.com/PHPjc/676860.html techarticle There are many ways to verify your email address. On the browser side, JS mailbox verification can be detected through regular expressions. For example: Copy code code as follows: function isemail (email) {return/^ (([a ...