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
/
(?:\G(?!\A)|{)[^{}]*?\K\([^()]*\)(?=[^{}]*})
/
gm
Input 1
1
New
{foo (i,j) bar} should match on (i,j) {(i,j) foo (k,l) bar (m,n,o)} should match on (i,j), (k,l), and (m,n,o). foo (i,j) bar should not match on anything because the string is not between swirly brackets. {foo (i,j) bar} (k,l) should match on (i,j) but not (k,l) because the latter is outside of the swirly brackets.
Extraction