Possible Duplicate:
Is there a php library for email address validation?
How to validate an email in php5?
I am aware that there have been plenty of questions regarding email address regular expressions. My question has a specific requirement that I have been unable to find the answer to.
I need a regex that matches email addressas and allows for address tags, such as “testing+tags@gmail.com”. Most regexes I have found fail on email addresses that contain a tag.
NOTE please do not point me to this link. I am looking for something practical, not perfect
EDIT I am aware of the existence of built-in validation in most web app frameworks. RoR, PHP, Django, etc all have it built in. Sometimes, though, for whatever reason, there is a special need. Maybe the user can’t use validation. maybe they are writing their app in some obscure language that doesn’t have built-in validation functions, or has them, but they are out of date. In that case, a regular expression is still useful
My personal favorite has always been this:
Another popular one is also
If you are doing this in PHP and if feasible for your problem, I would suggest using
filter_varas otherwise suggested. This is merely a suggestion should you need a regular expression that is practical and understood to be imperfect.