Re: regex problem with '@'

From: Date: Wed, 04 Oct 2000 01:24:31 +0000
Subject: Re: regex problem with '@'
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-18583@lists.php.net to get a copy of this message
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

« previous php.general (#18583) next »