Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
~
(\((?>[^()\n]+|(?1))*\))(?:([^()\n]+)((?1)))?
~
gm
Input 1
1
New
(weight gt 10) (weight gt 10) OR (weight lt 100) ((weight gt 10) OR (weight lt 100)) AND (length lt 50) (length lt 50) AND ((weight gt 10) OR (weight lt 100)) (length lt 50) nonsense ((weight gt 10) OR (weight lt 100)) (\((?>[^()]+|(?1))*\)) <-- original
Extraction