Posted By

jb3622 on 09/12/09


Tagged

email valid address


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

vali29
jfherring
jannisg


Check a valid email address


 / Published in: jQuery
 

  1. function isValidEmail(emailAddress) {
  2. var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
  3. return pattern.test(emailAddress);
  4. }

Report this snippet  

You need to login to post a comment.