> This only applies to PHP 4.0.4
> 
> Back with PHP 4.0.2, I could do this:
> 
> <?PHP
> $string = "[[";
> $string = preg_replace("/(\W)/", "\\\\1", $string);
> ?>
> 
> $string would then contain "\[\[".
> 
> Now, if I use that same code, $string contains "\\1\\1\\1\\1".
> 
> I tried to compensate for this using PHP's new ability to allow
> perl syntax in the replace section.
> 
> <?PHP
> $string = "[[";
> $string = preg_replace("/(\W)/", "\\$1", $string);
> ?>
> 
> That leaves $string with "\$1\$1\$1\$1".  Which tells me it thought
> I was backreferencing the $.  So, to combat said assumption, I tried
> three, four, even five slashes in front of $1, and nothing worked.
> All I got were variations of "\$1\$1\$1\$1".
> 
> I have to assume this is a bug, since this worked back in 4.0.2 which
> I stopped using due to segfaults under certain circumstances.
> 
> Ideas?

It is indeed a bug - I fixed it in CVS version if you want to try that.

-Andrei
* A feature is a bug with seniority. *

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to