JS code that verifies that the mailbox format is correct

  • 2020-03-30 00:43:26
  • OfStack

 
 
function chkEmail(strEmail) { 
if (!/^w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*$/.test(strEmail)) { 
return false; 
} 
else { 
return true; 
} 
} 

Related articles: