regex (preg_match) tld question
| From: | philip olson | Date: | Fri, 13 Oct 2000 19:30:54 +0000 |
| Subject: | regex (preg_match) tld question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-20068@lists.php.net to get a copy of this message | ||
greetings all-
question :
what would be a way to use preg_match to check all tlds ? what are
the possible types of tlds to watch out for ? here is snippet, all
thoughts apprecaited. is there a better way to go about doing this ?
function ValidateField($field,$value) {
if ($field == 'email_address' && $value)
{
if (!preg_match('/^[_\.\'0-9a-z-]+@(\w+\.)+( ALL TLDS )$/',$value))
{ ^^^^^^^^
print "Email is invalid"; /
$good = 0; check all tlds
}
$class->next_field();
continue;
}
}
or should i just look up the host ? if a host is temp down will it still
validate ?
thank you.
philip
--
be outside the box.