I have a list of function calls stored in a database, and for some function calls, I care about what the arguments of the function call are. I am parsing C source code with my program (which is in C#). I'm trying to find the best way of getting the function calls with the arguments. I read the source code into a string prior to parsing it (so that I am not using the stream reader on the file). I tried using some regex (which is somewhat new to me) to parse the source file, but was retrieving more than just the function call when using a regex string like this: functionCall + ".*\\)"; ( I am escaping the opening ( in the function call)
The function calls are stored in the following format in the DB
Function Call
============
some_Call(
There is a reason they are stored this way, and will not change.
Is there a good way to do this through regex, or would I be better suited to walk through the source code contents?
Let me know if any clarification is needed.