Re: Using eregi_replace()

From: Date: Fri, 01 Aug 2003 15:13:53 +0000
Subject: Re: Using eregi_replace()
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-157952@lists.php.net to get a copy of this message
* 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. $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."

« previous php.general (#157952) next »