Regular expression to match function name and all arguments in Python

前端 未结 3 946
囚心锁ツ
囚心锁ツ 2021-01-17 18:20

Suppose I have a string such as the following:

\"func(arg1, arg2, arg3, arg4, ..., argn)\"

EDIT: This function is not in some particular la

3条回答
  •  别那么骄傲
    2021-01-17 19:05

    Regular expressions cannot parse complex programming languages.

    If you're just trying to parse Python, I suggest taking a look at the ast module, which will parse it for you.

提交回复
热议问题