RE: [PHP] Which Regex library?

From: Date: Mon, 05 Feb 2001 15:40:01 +0000
Subject: RE: [PHP] Which Regex library?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38255@lists.php.net to get a copy of this message
well, i would try this: ereg('([0-9]+\.){4}', $email, $res); I'm not sure if that will work, but your expression is definitely not correct. I would reduce it down to its most basic element, perhaps, and try that: ereg('[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+', $email, $res); If that works, then just use that. johnny p. > -----Original Message----- > From: Shawn J. Wallace [mailto:lists@wa.ca] > Sent: Monday, February 05, 2001 8:17 AM > To: johnny p. > Cc: php-general@lists.php.net > Subject: RE: [PHP] Which Regex library? > > > Ok, this is from memory, but.. I'm trying to pull the IP > addresses of mail > relays out of an email - and they are of the form > [xxx.xxx.xxx.xxx], so I > do something like: > > ereg('\[(0-9\.)*]', $email, $res) > > It finds some but not all of them in the email. What I > really do is put > that in a while statement and replace each found ip with a > marker so I can > repeat the regex again and again. > --- > Shawn J. Wallace (shawn@justweb.com) > Justweb Inc. - http://www.justweb.com > (519)652-6599 or (800)343-9312 > > > -- > 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 (#38255) next »