allanbatista
7/1/2014 - 2:08 PM

Regex Validate Email

Regex Validate Email

function validateEmail(email){
  reg = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/
  
  return reg.test(email);
}