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
/
(TASK.+)\s*({[\s\S]*})\s*void
/
gm
Input 1
1
New
TASK(arg1) { if (cond) { /* Comment */ function_call(); if(condIsTrue) { DoSomethingelse(); } } if (cond1) { /* Comment */ function_call1(); } } void FunctionIDoNotWant(void) { if (cond) { /* Comment */ function_call(); } if (cond1) { /* Comment */ function_call1(); } }
Substitution
TASK(arg1) { if (cond) { /* Comment */ function_call(); if(condIsTrue) { DoSomethingelse(); } } if (cond1) { /* Comment */ function_call1(); } } void FunctionIDoNotWant(void) { if (cond) { /* Comment */ function_call(); } if (cond1) { /* Comment */ function_call1(); } }