Hi
I am trying to write a regular expression that will find any single backslashes and replace them with double (ie. escaped) backslashes.
Both of the following:
C:\Inetpub\wwwroot\mysite\myfolder\mysubfolder\
C:\Inetpub\wwwroot\mysite\myfolder\mysubfolder\
Should yield this:
C:\Inetpub\wwwroot\mysite\myfolder\mysubfolder\
After giving up on doing both a lok ahead and a look behind (how the hell does that work??!), I've tried this regex which I thought would do it:
$folder = preg_replace( '/([\])\([\])/', '$1\$2', $folder );
... but I get the following error:
Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 13
What am I doing wrong? Any ideas?
Cheers
voidstate