I have this regular expression:
(?<=\[\[)(.*?)(?=\]\]) for finding the pattern
[[some text inside]], and works, but I found a case where doesn't work:
[[[ some text]]].
I'm trying to find a solution, to only finding the pattern with double brackets in both sides like
Best How To :
Here it is, for selecting anything in between sets of
var str = "[[[ some text]]]"
var res = str.match(/((?!\])(?!\[).)+/g);
I think your edits made the question very different. Here is one that has strictly two starting and closing brackets.
You could use group 1 for selecting text only.