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
/
\b(?:if|for)\s*(\(([^()]++|(?1))*\))(?!.*{|.*\n.*{)
/
gm
Unit Tests
if(condition(test)
&&
bob)
sin…
→ regex does match
for(int
i=0;i<10;i++)
single_l…
→ regex does match
if(condition)
{
stuff;
…
→ regex does not match
if
(condition(test)
&&
condition(tes…
→ regex does not match
for
(auto
const
&x
:
y)
{
…
→ regex does not match