I am trying to replace ',",\ characters with blank.
I use the following code
jQuery.get('/path to file/file.txt',function(data){
data = data.replace(/\'\"\\/g," ");
alert(data);
})
but nothing replaced.
Where am I wrong?
Your expression would replace the 3 character sequence '"\ with a space, not the individual chars \, ' and ". Enclose them in a character class [] (and there's no need to escape with \ except for the \).
data = data.replace(/['"\\]/g," ");
// Example:
var str = "This string has internal \" double \\ quotes \\ and 'some single ones' and a couple of backslashes";
str = str.replace(/['"\\]/g," ");
// Output: all quotes replaced with spaces:
// "This string has internal double quotes and some single ones and a couple of backslashes"
\\ )