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:
def foo(cmd ,pIncludeAll #BOOL ,pOrderByDisplayOrder #BOOL ) : try: ....
What I need is a Regex that will produce a match result that contains each of the parameters without the comment like this:
cmd pIncludeAll #BOOL pOrderByDisplayOrder #BOOL
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.
cmd pIncludeAll pOrderByDisplayOrder
From novice to tech pro — start learning today.