The regular definition for recognizing identifiers in C programming language is given by
letter -> a|b|...z|A|B|...|Z|_ digit -> 0|1|...|9 identifier -&g
The regular expression you are looking for is:
[_a-zA-Z][_a-zA-Z0-9]{0,30}
It will match an underscore or letter following by X underscores, letters or numbers, where 0 <= X <= 30
X
0 <= X <= 30