preg_match
| From: | Daniel Reichenbach | Date: | Wed, 04 Jul 2001 12:04:31 +0000 |
| Subject: | preg_match | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-56159@lists.php.net to get a copy of this message | ||
Hy,
i've got a string which looks like "<dummy@yourserver.com>". Now i wanted
to check it with preg_match like this:
if ( preg_match(
'/[\<][a-z]([-a-z0-9_.])*@([-a-z0-9_]*\.)+[a-z]{2, }[\>]/i', $value ) ) {
print "Valid mail address";
} else {
print "Invalid mail address";
}
Unfortunatly this doesn't work. I think, i have to use a different syntax
for the "<" and ">" braces. Can somebody give me a hint?
Thx,
Daniel