Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

RE: [PHP] regexp. king needed (is it possible ???) From: Adrian Ciutureanu (adrian.ciutureanu <email protected>)
Date: 07/17/01

<?
        $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 <email protected>]
> Sent: 17 iulie 2001 17:38
> To: php-general <email protected>
> 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 <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail:
> php-list-admin <email protected>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>