I am trying to make a function that accepts string that looks like function call in python and returns the arguments to the function Example:
"fun(1, bar(x+17, 1), arr = 's,y')"
will result:
["1", "bar(x+17, 1)", "arr = 's,y'"]
The problem of using regular expressions is that I don't know if it is possible to not split at the commas inside parenthesis or quotes. Thanks.
Edit: this Python: splitting a function and arguments doesn't answer correctly the quastions since it doesn't treat commas in parenthesis or quotes.
As @Kevin said, regular expressions cannot solve this since they can't handle nested parenthesis.