[Tip] Validate email addresses
by Harjo Kompagnie
Direct ICT
Use this method to check for the validity of email addresses:
var x = 'harjo@directict.nl'
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x))
{
var b = 'YES! Correct email address'
}
else
{
var b = 'NO! Incorrect email address';
}
Comments (3)