I have this regex on Javascript :
var myString="[email protected]";
var mailValidator = new RegExp("\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*");
if (!mailValidator.test(myString))
{
alert("incorrect");
}
but it shouldn't alert "incorrect" with [email protected]
.
It should return "incorrect" for aaaaaa.com
instead (as example).
Where am I wrong?