There are many ways to verify email address. On the browser side, js mailbox validation can be detected by regular expressions.
Code is as follows
function isEmail(email) { return /^((([a-z]|
d|
[!#$%&'*+-/=?^_`{|
}~]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+(.([a-z]|
d|
[!#$%&'*+-/=?^_`{|
}~]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+)*)|
((x22)((((x20|
X09)*(x0dx0a))?(x20|
X09)+)?(([x01-x08x0bx0cx0e-x1fx7f]|
X21|
[x23-x5b]|
[x5d-x7e]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|
(\\([x01-x09x0bx0cx0d-x7f]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))))*(((x20|
X09)*(x0dx0a))?(x20|
X09)+)?(x22)))@((([a-z]|
d|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|
(([a-z]|
d|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|
d|
-|
.|
_|
~|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|
d|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))).)(([a-z]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|
(([a-z]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|
d|
-|
.|
_|
~|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|
[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])))$/i.test(email); }
or
function validateEmail(elementValue) { var emailPattern = /^[a-zA -Z0-9._]+[a-zA-Z0-9]+@[a-zA-Z0-9]+.[a-zA-Z]{2,4}$/; return emailPattern.test( elementValue); }
function checkEmail(mail) { return /^[w-]+(.[w-]+)*@([a-z0-9-]+(.[a-z0 -9-]+)*?.[az]{2,6}|
(d{1,3}.){3}d{1,3})(:d{4})?$/.test(mail); }
The call is simple:
Code
if (isEmail('[email protected]')){ console.log(' www.45it.net This is email is valid'); }View Code
If it is server side verification. Like php, the simplest one is:
The code is as follows
$a='/([w._]{2,10})@(w{1,}).([az]{2 ,4})/'; $b='[email protected]';
if(preg_match($a,$b)){ echo "email legal"; }else{ echo " E-mail is not legal. "; }
You need to assert whether a string of strings matches. Such as ^ $ /^([w._]{2,10})@(w{1,}).([a-z]{2,4})$/Note that the header and the tail are added ^ $
1. Creating a Site Folder First you have to create a new site folder
server hardware - the hard drive. If the motherboard is compared to the brain and the CPU is the hea
Sendmail server simple configuration First, sendmail introduction Second, Sendmail installation step
For the DHCP server, we understand some of its basic conditions and configuration
Windows 2000 server IIS open the parent path step
Bago Learning Server 2003 - Deployment File Service
Play classic games under Linux system CS1.5 server setup
Apache 80 port is occupied by iis how to solve
Skills delivery: three moves to improve the security of the FTP server
Restart IIS old prompt does not support this interface error resolution
Server temporarily solves ARP spoofing attack method
Microsoft Windows 8 latest eight points must know
How to set Win10 power saving mode? Win10 method to set power saving mode
Win7 desktop ie icon can not be deleted Solution
How to install Baidu Post Bar customer service
Win10 Preview provides full desktop, windowed operation speeds up desktop application startup speed
QQ mailbox can not receive the mail how to solve?
Discuz (1040) notconnect error solution