martindavey
Programmer
I have a string that contains a dos path (several back slashes).
I want to replace them with forward slashes.
I get an error (expected ']') when I define the regular expression:
var myStr = "c:\path\file";
var Reggy = new RegExp( "[\\]","g" );
myStr = myStr.replace( RegExp, "//" );
Any ideas (the above will work for other characters, I'm just having trouble with the backslash) ???
I want to replace them with forward slashes.
I get an error (expected ']') when I define the regular expression:
var myStr = "c:\path\file";
var Reggy = new RegExp( "[\\]","g" );
myStr = myStr.replace( RegExp, "//" );
Any ideas (the above will work for other characters, I'm just having trouble with the backslash) ???