I didn’t want to us a plugin for simple email validations so i tried to create my own but it doesn’t work. Its always returning false. Here is my code:
var regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i;
if(regex.test($("#email").val()))
{
//pass
}
What am I doing wrong? Thank you!
I would assume that
\Ais supposed to be^and\zis supposed to be$.