I want read out variable which is mentioned below in file.
#define xyz_u8 abc_0x0_u8 = 0x0 (for hex)
#define xyz_f16 abc_MOD1_f32 = -0.1f (for int and float)
#define xyz abc_YY = YY_ZZ (for others)
I am using
re.compile(r"^#define\s+(\w+)\s+(\w+)(0[xX][0-9a-fA-F]+)")
for reading hex, but i am not able to get value from '='. Can anyone correct the regular expression.
.*or.+at the end? Try(?i)^#define\s+(\w+)\s+(\w+) = (.+)(SET\w+)\((GET\w+)(?:(?:\([^()]*\)/\d+)?\W+(GET\w+))?.