I am trying to match numbers in Qt for syntax highlighting, and I am trying the following regexes:
"[^a-fA-F_][0-9]+" // For numbers.
"[^a-fA-F_][0-9]+\\.[0-9]+" // For decimal numbers.
"[^a-fA-F_][0-9]+\\.[0-9]+e[0-9a-fA-F]+" // For scientific notation.
"[^a-fA-F_]0[xX][0-9a-fA-F]+" // For hexadecimal numbers.
But the text is matching, for example, [1024, and highlighting the [ too. I wanted to highlight only the 1024 part.
Another problem is that the regex highlights when I type aoe2 and when I type aoe25. I don't want to highlight the number when it is preceded by letters or underscores, because then it would be an identifier.
How can I solve that?