Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 2000051

Re: [PHP3] Multiple RegExp replace From: Alfred Perlstein (bright <email protected>)
Date: 05/01/00

* Nicholas Pappas <nick <email protected>> [000501 10:25] wrote:
> > $string = eregi_replace("(http://[a-z.]*)",
> > "<A HREF=\"\\0\">\\0</A>", $string);
> >
> > if \\0 doesn't work, use \\1
>
>
> Thanks Alfred,
>
> Can you point me to the reference you found this in? ... or did I
> just miss in the docs, and am now making a fool of myself.

The docs are under ereg_replace().

But don't feel bad, regex has never been intuative, although the
docs are good the concepts are complex. I've just been doing this
sort of stuff for many years, in fact that's the first time I've
really tried to understand the \\1 construct and it took me a couple
of tries to get it right (I hope). :)

-- 
-Alfred Perlstein - [bright <email protected>|alfred <email protected>]
"I have the heart of a child; I keep it in a jar on my desk."

-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>