I'm currently trying to parse a text file and find any hexadecimal numbers within it. If the hexadecimal number is incorrect I have it display as not number.
input:
-0xA98F
0XA98H
0x123
0xabc
expected output:
-0xA98F valid
0x123 valid
0xabc not valid
0xA98H not valid
My problem is if I get something like 0xA98H it will output as 0xA98 and display as a number. My goal is to is to get my output like my example however i do no see any resolution to my problem.
[-]?[0][x|X][0-9A-F]+ {cout << yytext << " Number" << endl; }