in reply to Re: regex to validate e-mail addresses and phone numbers
in thread regex to validate e-mail addresses and phone numbers
While I agree with your suggestion of Email::Valid in principal, it may not be the right solution for the task at hand. I am guessing there is more to this than was originally stated. It might be best to first ask some simple questions:
Am I validating inbound, outbound, or bi-directional addresses?
Does my inbound MTA comply with the RFCs? If not is it more strict, more relaxed, or bits and pieces of both?
Do I care if it is valid? If it "looks" like a spammer, I want to drop it regardless.
It may turn out that a home-grown regex is the right way to go, it may turn out that Email::Valid or Email::Valid::Loose is the way to go. It may even turn out that the best solution is SpamAssasin.
Cheers - L~R