I\'m trying this:
str = \"bla [bla]\"; str = str.replace(/\\\\[\\\\]/g,\"\"); console.log(str);
And the replace doesn\'t work, what am I do
You have to escape the bracket, like \[ and \]. Check out http://regexpal.com/. It's pretty useful :)
\[
\]
To replace all brackets in a string, this should do the job:
str.replace(/\[|\]/g,'');
I hope this helps. Hristo