note 45695 added to function.eregi
| From: | rq at i dot dislike dot spam dot --- dot akl dot lt | Date: | Wed, 15 Sep 2004 15:09:49 +0000 |
| Subject: | note 45695 added to function.eregi | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76734@lists.php.net to get a copy of this message | ||
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);
}
----
Manual Page -- http://www.php.net/manual/en/function.eregi.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45695
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45695&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45695&report=yes
Search -- http://master.php.net/manage/user-notes.php