The SD Source Code Search Engine is an interactive tool for searching source code for many languages (C, C++, C#, Java, PHP, COBOL, FORTRAN, Python, ...). It understands the lexical syntax of each language at the same level of detail as the corresponding language compiler, so it knows and can distinguish easily keywords, identifiers, numbers, operators, punctuation and whitespace.
The Search Engine can be given queries in terms of these entities and constraints on their values and will search the code for all matches, will display the matches and then will let you inspect source code for each match with a single mouse click. Because it understands lexical syntax, it isn't fooled by comments, whitespace or content.
For example, you can find all identifiers containing the letters TAX by writing a widlcarded identifier (I) search:
I=*TAX*
You can find all numbers in a file greater than 50 and less than 72:
N>50<72
and it will find them regardless of radix or syntax, because it knows the langauge syntax.
You can find all the for loops with an upper bound of 50 or more:
'for' ... I '<' N>50
If you want to simply find all the constants in the conde, just write an unconstrained search for numbers:
N
A logging facility can write all the hits to an XML file for later processing if you like.