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]

Reply via email to