PHP Mailbox Validation Regular expression
The code is as follows |
Copy Code |
Preg_match ("/^[0-9a-za-z]+@" ([0-9a-za-z]+) [.]) +[a-z]{2,4}$/i ", $email); |
Example of a PHP mailbox validation regular expression
The code is as follows |
Copy Code |
<?php function Isemail ($email) { if (Preg_match (/^[0-9a-za-z]+@ ([0-9a-za-z]+) [.]) +[a-z]{2,4}$/i ", $email)) { Return ' mailbox verification OK '; } else { Return ' verify not mailbox '; } } ?>
Myreg =/^ ([a-za-z0-9]+[_|_|.]?) *[a-za-z0-9]+@ ([a-za-z0-9]+[_|_|.]?) *[a-za-z0-9]+. [A-za-z] {2,4}$/
|
Example of a mailbox validation regular expression
Example 1
The code is as follows |
Copy Code |
<script type= "Text/javascript" > Function Isemail (val) { var myreg =/^ ([a-za-z0-9]+[_|_|.]?) *[a-za-z0-9]+@ ([a-za-z0-9]+[_|_|.]?) *[a-za-z0-9]+. [A-za-z] {2,4}$/;
if (!myreg.test (val)) Return ' not a mailbox '; Return ' is the mailbox '; }; Alert (Isemail (' i@fufuok.com ')); </script> |
Example 2
code is as follows |
copy code |
/** * Email format Verification * @param {Object} email address content */ function emailformatcheck (email) { if ((Email.length > 128) | | (Email.length < 6)) { return false; } var format =/^[a-za-z0-9+]+[a-za-z0-9._-+]*@ ([a-za-z0-9-]+.) +[a-za-z0-9]+$/; if (!email.match (format)) { return false; & nbsp; } return true; } |