RE: [PHP] preg_match
| From: | Adrian Ciutureanu | Date: | Wed, 04 Jul 2001 12:09:45 +0000 |
| Subject: | RE: [PHP] preg_match | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-56161@lists.php.net to get a copy of this message | ||
try
ereg('^([a-z,A-Z,0-9]|_|-|\.)+@([a-z,A-Z,0-9]|_|-|\.)+\.([a-z,A-Z,0-9]|_
|-|\.){2,3}$', $email)
> -----Original Message-----
> From: Daniel Reichenbach [mailto:daniel.reichenbach@pixum.com]
> Sent: 4 iulie 2001 15:05
> To: Php-General
> Subject: [PHP] preg_match
>
>
> 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
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
>