I'm trying to extract a list of parameter names from a Python script. Here's an example of what I'm looking at
Currently, I'm using a Regex that grabs everything between the parentheses then just splitting on the comma. This doesn't work in the above case since there are comments after 2 of the 3 parameters. My split string ends up looking like this:
What I need is a Regex that will produce a match result that contains each of the parameters without the comment like this:
I know I need to delimit the Regex match on commas, whitespace, and pound signs. I just don't know how to write the expression so that it will return a proper match against an arbitrary number of arguments.