Re: Using eregi_replace()

From: Date: Fri, 01 Aug 2003 15:28:37 +0000
Subject: Re: Using eregi_replace()
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-157961@lists.php.net to get a copy of this message
On Fri, Aug 01, 2003 at 03:13:53PM +0000, Curt Zirzow wrote: > * Thus wrote messju mohr (messju@lammfellpuschen.de): > > On Fri, Aug 01, 2003 at 10:33:50AM -0400, Anthony Ritter wrote: > > > > i would suggest preg_replace in favour to ereg_replace: > > $newtext= preg_replace("!.*?(hello.*going).*!","$1",$text); > > Doesn't the $1 need to be escaped or in single quotes so php > doesn't touch it. sorry, i wanted to say '$1' and not "$1". > $newtext= preg_replace("!.*?(hello.*going).*!","\$1",$text); > or > $newtext= preg_replace("!.*?(hello.*going).*!",'$1',$text); > > I cant test it at the moment. > > Thanks > > > > > it is more powerfull, faster and widely available. > > I agree, I like now that PREC is now compiled by default. > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure." > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#157961) next »