Re: Email validation
| From: | Manuel Lemos | Date: | Fri, 14 Jun 2002 05:50:58 +0000 |
| Subject: | Re: Email validation | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-102151@lists.php.net to get a copy of this message | ||
Hello,
On 06/13/2002 11:49 PM, Timothy J. Luoma wrote:
On Wed, 12 Jun 2002, Pedro Pontes wrote:The following classes use this validation regular expression string. It does not exclude some invalid addresses but includes all valid addresses. "^([-!#\$%&'*+./0-9=?A-Z^_function checkEmail($strEMailAddress) { return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$", $strEMailAddress); } You have it now :).I'm still learning my PHP regex... does the above allow someone to have a literal "+" in their email address, ala <luomat+php@peak.org> which is perfectly valid, but often rejected by "email validators"?
a-z{|}~?])+@([-!#\$%&'*+/0-9=?A-Z^_a-z{|}~?]+\\.)+[a-zA-Z]{2,4}\$"
Forms generation and validation
http://www.phpclasses.org/formsgeneration
E-mail address validation
http://www.phpclasses.org/emailvalidation
--
Regards,
Manuel Lemos