RFC 2822 Email Validator in PHP

Here’s regex pattern that checks for email validity that conforms to RFC 2822 specs : regex.txt
This may be useful for you if you’re writing a robust email validation class/function in PHP, that checks for validity according to specs. This will also indirectly address security concern against injection attempt by malicious users.
Additionally, there’s a demo with complete source code for checking email validity using eregi : Validate Email Addresses using Regular Expressions

If you are planning to validate email addresses for use in a home-made php mailer form, then you should read this too : Sanitize Your Forms

You might find it handy as it guard your form againsts malicious users that want to manipulate your form to do Email Injection for spam purposes
[tags]php,regex,email,validator,validate,source code,spam,injection[/tags]