Clayton Dukes wrote:

> Okay, here's what I have so far:
> 
> ---snip---
> if ((!$email)
>        || ($email=="")
>        || (!eregi("^[_\.0-9a-z-]+@domain.+[a-z]",$email))
>        )
>     $stop = "<center>"._ERRORINVEMAIL."</center><br>";
> ---snip---
> 
> This works, but how can I add a second domain?
> ie:
> 

Try:

^[_\.0-9a-z-]+@(domainA|domainB|etc)\.[a-z]{2,3}$

A complete email address check is insanely hard to to if you want to get 
RFC 822 compliant-checking, but who needs that anyways? (fwiw, the regex in 
Mastering Regular Expressions for checking email address syntax is some 
4,700 bytes long.)

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to