views:

97

answers:

1

Possible Duplicate:
Is there a php library for email address validation?

Hi there, I was just wondering if any of you use a particular public script or set of functions for dealing with email validation in PHP. The built-in PHP function isn't really anything to brag about.

Thanks for your time.

+1  A: 

I use to validate with cakephp function which can be found here

The regexp is this one:

'^[a-z0-9!#$%&*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+(?:[a-z]{2,4}|museum|travel)$'

and can be found here

Enrico Carlesso
Great! Thanks, I'll check it out
soren.qvist
At the end it also excludes museum and travel?
soren.qvist
No, it validates every 2-4 letter first-level domain (com, it, en, es, uk, org...) and the two long exceptions, .museum and .travel (which are first-level domains to, as shown http://en.wikipedia.org/wiki/Generic_top-level_domain).In simple words, museum and travel are the only two first-level domain longer than 4 char, so must be included.
Enrico Carlesso
Oh, didn't even know those existed. Thanks.
soren.qvist
You're welcome.
Enrico Carlesso