RE: [PHP] regex problem with '@'
| From: | Jeroen Wesbeek | Date: | Wed, 04 Oct 2000 13:27:05 +0000 |
| Subject: | RE: [PHP] regex problem with '@' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-18586@lists.php.net to get a copy of this message | ||
what about:
if
(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",$mail))
{
$ok++;
}
dowebwedo
Jeroen Wesbeek
.programming
St. Jacobsstraat 16
Postbus 448 | 3500 AK Utrecht
The Netherlands
p 030 2348110 | f 030 2348605
[roses are red, violets are blue,
I am schizophrenic and so am I ]
-----Original Message-----
From: Jason Lavigne [mailto:jlavigne@stonecroft.net]
Sent: woensdag 4 oktober 2000 3:25
To: PHP List
Subject: Re: [PHP] regex problem with '@'
I used the following to check for @ for an E-Mail address validator, maybe
this could help.
$retval = 1;
$retmsg = "Good E-Mail";
$comp1 = "@";
$comp2 = ".";
if (!strstr($e_mail,$comp1)) {
$retval = 0;
$retmsg = "Invalid";
}
if (!strstr($e_mail,$comp2)) {
$retval = 0;
$retmsg = "Invalid";
}
Jay
----- Original Message -----
From: "Maxim Maletsky" <maxim@japaninc.net>
To: "'Tony Bailey'" <tony@jag-lovers.org>
Cc: "'PHP General List. (E-mail)'" <php-general@lists.php.net>
Sent: Wednesday, October 04, 2000 9:19 AM
Subject: RE: [PHP] regex problem with '@'
> I am not sure about what I'm answering, but, don't you need to comment an
@
> with a backslash?
>
> -----Original Message-----
> From: Tony Bailey [mailto:tony@jag-lovers.org]
> Sent: Wednesday, October 04, 2000 10:13 PM
> To: php-general@lists.php.net
> Subject: [PHP] regex problem with '@'
>
>
> Anyone put me out of my misery and tell me how to alter this to work?
>
> if ( ereg("@", $line) )
>
> It always returns true as is....
>
> TIA
>
> Tony
>
>
>
> --
> 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
>
>
----------------------------------------------------------------------------
----
> --
> 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
--
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