note 45695 deleted from function.eregi by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 15 Sep 2004 15:46:03 +0000 |
| Subject: | note 45695 deleted from function.eregi by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76742@lists.php.net to get a copy of this message | ||
Note Submitter: rq at i dot dislike dot spam dot --- dot akl dot lt
----
a correction to the email vlidation function by joseph dot ragsdale at xconduit dot com:
// check if email address is valid
function validate_email($address) {
$regex =
'^'.
'[_a-z0-9-]+'. /* One or more underscore, alphanumeric,
or hyphen character. */
'(\.[_a-z0-9-]+)*'. /* Followed by zero or more sets consisting
of a period and one or more underscore,
alphanumeric, or hyphen characters. */
'@+'. /* Followed by an "at" character. */
'[_a-z0-9-]+'. /* Followed by one or more underscore,
alphanumeric, or hyphen characters. */
'(\.[_a-z0-9-]+)*'. /* Followed by zero or more sets consisting
of underscode, alphanumeric or hyphen
characters. */
'(\.[a-z]{2,})+'. /* Followed by one or more sets consisting
of a period and two or more alphanumeric
characters. */
'$';
return eregi($regex, $address);
}