Re: regular expressions

From: Date: Sat, 10 Apr 2004 00:13:56 +0000
Subject: Re: regular expressions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-183039@lists.php.net to get a copy of this message
Saturday, April 10, 2004, 2:02:04 AM, you wrote: > I'm trying to 'clean up' some text that is extracted from a web > directory, and I need to use (I think) preg_replace or ereg_replace, > etc. I've read a bunch of tutorials, but none of them seem to cover the > particular thing I want to do. Here's an example of text I need to > process: > --------- > J. Smith   ( More Info ) > map > driving directions > add to My Directory > update or remove > Did you go to High School with J. Smith? <snipped> without further ado: $str = <your stuff here>; $what = array("/\r\nupdate or remove/", "/\r\nDid you go.*\?\r\n/i"); $with = array('', ''); echo preg_replace($what, $with, $str); hth Richard

« previous php.general (#183039) next »