Re: php and replace vs. perl $data=~ s/<BR>\n//;

From: Date: Mon, 19 Jun 2000 13:15:03 +0000
Subject: Re: php and replace vs. perl $data=~ s/<BR>\n//;
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-21727@lists.php.net to get a copy of this message
On Mon, 19 Jun 2000, Jani Ollikainen wrote: > I've been wondering is there a replace function which does not > replace all matches? If there is, some one could point me out > which is it. If not, i think there should be one. > Even preg_replace knows only /e modifier, no /g like in perl. > And first i tought that this is covered in todo: > * have a non-greedy option for preg_replace(). > but, then i heard that, that hasn't anything to do with > that situation. I'm not so expert in regexp, but now i > know what non-greedy means and what i wanted isn't it. > > ps. i'm not on the list so cc me. Yes, by non-greedy I meant preg_replace() that doesn't process all the instances of regexp matches it finds - only some of them. -Andrei "Man, if you gotta ask you'll never know." - Louis Armstrong, when asked "What is jazz?"

« previous php.dev (#21727) next »