|
Posted by Rik on 11/19/54 11:46
veg_all@yahoo.com wrote:
> $string1 = preg_replace ( '/Hello.*(?!today)/', 'Hello ***' , $string1
> $string1 = 'Hello world today';
'Hello world today' isn't followed by "today", so it returns true,
Read up on regexes.
Learn what (.*?) means.
$string1 = preg_replace ( '/Hello(.*?)( today)/', 'Hello ***\2' , $string1);
Grtz,
--
Rik Wasmus
[Back to original message]
|