On Fri, Aug 01, 2003 at 04:51:38PM +0100, skate wrote: > > > > you could also use different delimiters and write for example: > > '/.*?(hello.*going).*/' or '[.*?(hello.*going).*]' the regular > > expression itself is merely ".*?(hello.*going).*" which matches the > > whole string and replaces it by the first matching expression > > sourrounded in by ()s (thats the '$1'). > > > > > > just a minor correction, i don't believe you could use > '[.*?(hello.*going).*]' as the delimiters have to be the same character.
http://php.net/manual/en/ref.pcre.php : "... Since PHP 4.0.4, you can also use Perl-style (), {}, [], and <> matching delimiters. ..." > the reason you use delimiters is so that you can use PREG modifiers after > the last delimiter, but still inside the expression. read up in the manual, > as the posibilities of PREG are enourmous... full ACK :) > -skate- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php