Saturday, March 16, 2013

Javascript Regex for Email Validation

function IsEmail(email) {
  var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  return regex.test(email);
}
 
This Function return a true value is Email is valid. Else false will be returned.

No comments:

Post a Comment