Please edit the link as Validating Email Addresses The Wrong Way
The right way is
filter_var('bob@example.com', FILTER_VALIDATE_EMAIL);
Same for validating the domain.
And also : http://news.ycombinator.com/item?id=4486108