It's not so much off topic as a perennial topic - see archives and many
tutorial articles.
When you've worked out the answer to this question, please try out your
algorithm on my (or any other 'foreign') address. Then consider the imminent
introduction of further TLDs, eg .info (four characters), .family, etc.


PS Sorry, can't help with POSIX RegExs - I confuse myself without any
outside assistance using the PCRE variants.

> I hope this isn't too far off topic -
> I have a regex for validating email addresses -
> if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-])+\.
> ([A-Za-z]{2,3})+$", $useremail))
> Notice the {2,3} which is supposed to limit the last part to 2 or 3
> letters, but I have been testing this and
> it allows as many letters as I put in there, but not 1 only.
> What's wrong?
> Also, when using eregi do I need to specify A-Za-z or just a-z, since it
> case-insensitive?
> --
> Chip Wiegand
> Computer Services
> Simrad, Inc
> "There is no reason anyone would want a computer in their home."
>      --Ken Olson, president, chairman and founder of Digital Equipment
> Corporation, 1977
>  (They why do I have 9? Somebody help me!)
> --
> PHP Database Mailing List (
> To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to