[PHP] Email - format

2004-02-21 Thread Sheni R. Meledath
Hello:

Can any body provide me with a regular expression (as per the latest 
standards) to check the validity of an email address.

I am using some of the below formats. But these formats are not handling 
all the email addresses.

Format I:

ereg(^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$, 
$email)

Will not accept hyphen (-) in the email addresses.

Format II:

eregi(^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$,$email)

Will not accept domains like y.net.ye

Please suggest a regular expression which will reject only email addresses 
which are 100% invalid.

Sheni R Meledath
[EMAIL PROTECTED]  

Re: [PHP] Email - format

2004-02-21 Thread John W. Holmes
Sheni R. Meledath wrote:

Can any body provide me with a regular expression (as per the latest 
standards) to check the validity of an email address.
This is covered over and over and over, 100s of times (literally) in the 
manual. Look through the comments in either of the regular expression 
chapters.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php