Regex to parse C/C++ functions declarations

前端 未结 3 1255
夕颜
夕颜 2020-12-18 07:36

I need to parse and split C and C++ functions into the main components (return type, function name/class and method, parameters, etc).

I\'m working from either heade

3条回答
  •  时光取名叫无心
    2020-12-18 08:11

    No. Even function prototypes can have arbitrary levels of nesting, so cannot be expressed with a single regular expression.

    If you really are restricting yourself to things very close to your example (exactly 2 arguments, etc.), then could you provide an example of something that doesn't match?

提交回复
热议问题