I am attempting to parse a function call:
foo(arg1, arg2 ...)
to match for foo, arg1, arg2. But the issue I'm having is, arg1 may be bar(x1, x2) with commas inside.
When I use this tool with ([\w]+)\((.*?)\)$ as my regex and foo(bar(2,'a'), bas()) as my test case, I'm able to capture foo and the entire line of arguments bar(2,'a'), bas(), but I'm not sure how to capture the arguments separately.
I would like to capture:
foobar(2,'a')bas()
How do I revise my python regex to capture these argument separately?