I am doing email regular expression validation for the email and I am stuck on one point using
following expression if user enter something like abc.abc
then this expression works fine but when user enters [email protected]
then it doesn't work
var myreg = new RegExp(/([a-z0-9.]+)@([a-z0-9]+)\.([a-z0-9]+)/i);
var patter = myreg.test(document.getElementById("email").value)
alert(patter)
if(patter == false){
errorMsg.push("email Formate Error Ex:[email protected]");
}
I want that user must enter his email in this formate like [email protected]/.ca/.org