> <?PHP
> $string = "[[";

Okay.  I don't think [ is special in PHP.  { is a new special character,
though.

> $string = preg_replace("/(\W)/", "\\\\1", $string);

\W  -- what's that?  You probably need \\W there...

> ?>
>
> $string would then contain "\[\[".

I dunno about that.  This Regex stuff is over my head usually.  I find that
I can usually write a str_replace and/or use strtok and write a mini-parser
faster than I can wrap my poor little brain around all those secret
characters.



-- 
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