I need to parse a C code using regex and I'm having difficulty knowing if a variable is getting a float or integer value.
Ex:
valor_01 = ( 5 * 3 ) / 2.5 + ( 4 % 3 ) ^ 4 ;
valor_01
can be any variable name, something like \w+
=
and before ;
has some decimal value ( 2.5
in this example) (\w+\s?\=\s?).+
Problem: With this expression I get the name of the variable, the equal and everything I have on the line and I can not find out if it has a (\d+.\d+)
and a ;
at the end of the line.
It's like I need to capture
value_01 = 2.5;