Re: More Email ereg Validation
| From: | Dan Wilson | Date: | Thu, 05 Apr 2001 16:08:13 +0000 |
| Subject: | Re: More Email ereg Validation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-47281@lists.php.net to get a copy of this message | ||
: dan@acucore.com says...
: }I'm trying to parse the different "parts" of an email address both for
: }validation and munging.
: }
: }I have the following regex:
: }([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{3})
: }
: }This works great, except it doesn't accept the country code domains (.au,
: }etc). So I changed the number of characters to {2,3} at the end of the
: }regex:
: }([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{2,3})
: }
: Here's a quick patch.. =)
: ([a-z0-9_\.\-]+)@([a-z0-9\.-]+).([a-z]{2}[a-z]?)
Sorry, but that doesn't work. I thought it would, but it only does two
characters on the top level domain again. Tested at
http://www.php.comzept.de/rexpr (thanks Jörg!)
Does anyone else (a regex guru) have any other suggestions?
Thanks,
-Dan