Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
outer Parentheses
Open Workspace
PCRE (Legacy)
Match
Created 2014-04-25 11:43
4
Regular Expression
/
(
\(
(?:
(
[^
\(\)
]
*
)
|
(?:
(?2)(?1)(?2)
)*
)
\)
)
/
Description
Finds the outermost pair of parentheses. Compatible with any amount of nesting
Submitted by
Jonas Gerneth