Re: Using eregi_replace()

From: Date: Fri, 01 Aug 2003 15:58:25 +0000
Subject: Re: Using eregi_replace()
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-157974@lists.php.net to get a copy of this message
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-

« previous php.general (#157974) next »