I am trying to find function names in source codes but not in function declarations. Let's say we have the following source code:
function foo()
{
if ( ! foo5() )
foo3(bar("string"), foo2());
else
foo3(bar("string"));
}
function foo4()
{
if (!foo5())
bar2(bar("string"), foo2());
else
bar2(bar("string"));
}
I want to extract foo5
,foo3
,bar
,foo2
,bar2
but not foo
and foo4
I tried the following regex with no luck
(?<!function )(\w+)\(
All words that have open parenthesis but not started with function