On 4/9/07, The Editor <[EMAIL PROTECTED]> wrote:
> Thanks Christian, I did try that early on, with no luck--in fact that
> was my initial code. Can't really understand why it is doing what it
> is...
In PHP 4.0.4+, backreferences are of the form \\n and $n .. The
problem arises because of the $n notation in the replacement
string.... I've done a fair bit of digging and it doesn't look like
there's a way to disable the replacement. The only thing I can think
to do would be to prepend any $'s with a double backslash via another
preg_replace prior to this one...
This seems to work :
$v = preg_replace('/(\$[0-9])/', '\\\\$1', $v);
> I ended up doing a temporary string replacement of $ to -$- and then
> string replace it back, but there ought to be a 'right' way to do
> this... Thanks again!
Kinda the same thing as what I have, just in reverse.. :)
> Cheers.
> Dan
--
Jason 'XenoPhage' Frisvold
[EMAIL PROTECTED]
http://blog.godshell.com
_______________________________________________
pmwiki-devel mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel