Re: regexp. king needed (is it possible ???)

From: Date: Tue, 17 Jul 2001 15:03:48 +0000
Subject: Re: regexp. king needed (is it possible ???)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-58275@lists.php.net to get a copy of this message
thanks my king :) it works !!! "Adrian Ciutureanu" <adrian.ciutureanu@softure.com> schreef in bericht news:695649D3DC057E4DB74AAE8F9867D5D00583A5@fix02s.fix.ro... <? $s = 'somthing opentag1 .........any content in between ............. closetag1 somthing else'; $opentag = 'opentag1'; $closetag = 'closetag1'; $other_content = 'the other content'; $content = ereg_replace(".*$opentag", '', ereg_replace("$closetag.*", '', $s)); $new_str = ereg_replace("$opentag.*$closetag", "$opentag $other_content $closetag", $s); // $content = ' .........any content in between .............. '; // $new_str = 'somthing opentag1 the other content closetag1 somthing else' ?> $content = '<?=$content?>';<br> $new_str = '<?=$new_str?>' > -----Original Message----- > From: Jeroen Olthof [mailto:j.olthof@millipede.nl] > Sent: 17 iulie 2001 17:38 > To: php-general@lists.php.net > Subject: [PHP] regexp. king needed (is it possible ???) > > > ereg_replace("$opentag([^*]*)$closetag", > $this->OPENTAG.$loopHandle.$this->CLOSETAG, $template); > > how do I get al hold on the "\\1" part of the replacement. > basicly I want to replace > > opentag1 .........any content in between .............. closetag1 > > with > > opentag2 onewordonly closetag2 > > but still need the > > .........any content in between .............. > > is this possible in some way ??? > > kind regards > Jeroen Olthof > > > > > > -- > 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 (#58275) next »