JavaScript Email Validation

Posted by Lakhangarg under JavaScript category on | Views : 2716
Method To validate Email ID With the Help of Regular Expression.

function check for valid email address
function IsvalidEmail(src)
var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
var regex = new RegExp(emailReg);
return regex.test(src);

Remove White Space from Start and From End
str = this != window? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');

Comments or Responses

Login to post response