String view:
var str = "some text [[[[test 1]] test 2]] other text";
How to remove everything in square brackets, including the brackets themselves?
My decision:
new_str = str.replace(/\[.*\]\].*\]\]/gi,"");
Doesn't quite fit, what's wrong?
updated as advised:
var str = "some text [[[[test 1]] test 2]] other text"; new_str = str.replace(/\[\[(.)+\[\[(.)+\]\] \]\]/i,''); alert(new_str);
As a result, the entire line returns.