I tried to validate my email in PHP after entering the email field in the HTML form... This is my email validator. if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$EmailAddress)) Code (markup): It validates when the e-mail is incorrect, however it doesn't accept email address with dots, that is suppose to be valid. I don't know how to insert the dot or point to be a valid email address... for example: - Valid - Invalid Why did my validator doesn't accept an email with a dot in the name. I hope someone can answer this or correct my code
<?php $email="subikar@myblogplanner.com"; if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9- ]+)*(\.[a-z]{2,3})$", $email) { echo "The e-mail was not valid"; } else { echo "The e-mail was valid"; } ?> Try this code this may help you out.