Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\[\[((?>[^\[\[\]\]]|(?R))*\]\])
/
g
Input 1
1
New
text1 = [[ string ]] text2 = [[ multiline string ]] text3 = [[ multiline string with [[ nested brackets ]] matches a balance number of brackets ]] text4 = [[ [[ [[ ]] ]] ]] ]] ]] (the two last ones could not be matched)
Extraction
text1 = [[ string ]] text2 = [[ multiline string ]] text3 = [[ multiline string with [[ nested brackets ]] matches a balance number of brackets ]] text4 = [[ [[ [[ ]] ]] ]] ]] ]] (the two last ones could not be matched)