And besides ereg_replace would not work becase it's greedy, .* would match "going", than "going" would not be found and the whole match would fail.

messju mohr wrote:

you mean
$newtext= ereg_replace(".*?(hello.*going).*","\\1",$text);
??

i would suggest preg_replace in favour to ereg_replace:
$newtext= preg_replace("!.*?(hello.*going).*!","$1",$text);

it is more powerfull, faster and widely available.

greetings
messju



echo $newtext;
?>
...........

Thank you.
Tony Ritter




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to