![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: Regex - how to match until something
From: Rik <luiheidsgoeroe@hotmail.com>
Date: Sun Apr 30 2006 - 02:55:54 CEST
veg_all@yahoo.com wrote:
> $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 WasmusReceived on Mon May 1 03:07:36 2006 |