I am parsing a C code file using Python and I need to find all function calls, but not function definitions. For example:
txt = "foo(param1, bar1(foobar()), param2, !bar2(param3));"
should give me something like foo, bar1, foobar, bar2.
The regex I am using is "\w+\(" :
import re
x = re.findall("\w+\(", txt)
but then it will also match function definition like this:
text = "void foo(int param) {"
How do I modify my regex?