Re: What does \\0 means?
| From: | John Nichel | Date: | Thu, 05 Aug 2004 12:56:27 +0000 |
| Subject: | Re: What does \\0 means? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192845@lists.php.net to get a copy of this message | ||
On Thursday 05 August 2004 07:39, Jay offered up the following tid-bit of
information :
> Hi!
>
> Found the following code in the PHP manual:
> $text = "http://www.somelink.com";
> echo(ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",
> "<a href=\"\\0\">\\0</a>", $text));
>
> What does \\0 means, i have seen this before with \\1 and \\2
>
> what does they mean?
>
> Thanx In Advance
> Jay
Well, I'm not much of a ereg guy...more preg, but if I had to take a guess,
the \\0 in ereg is like $1 in perl regular expressions. ie it's replacing
the \\0 with the first match found in the expression. Run the script...I'm
betting it will out put...
<a href="http://www.somelink.com">http://www.somelink.com</a>
Course, if I'm wrong, someone on the list will be quick to lay the smack
down on me, and you'll get the correct answer. ;)
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com