Regular expression to recognize variable declarations in C

后端 未结 5 1347
我寻月下人不归
我寻月下人不归 2021-01-03 11:50

I\'m working on a regular expression to recognize variable declarations in C and I have got this.

[a-zA-Z_][a-zA-Z0-9]*

Is there any bette

5条回答
  •  抹茶落季
    2021-01-03 12:32

    This is the complete form of a variable name.

    Just a little modification done for which you can use multiple _ if you wish.

    ([a-zA-Z_][a-zA-Z0-9]*)*
    

提交回复
热议问题