The SD Source Code Search Engine is probably what you are looking for. It uses language-aware scanners (C, C++, C#, Java, PHP, COBOL, JCL, PLSQL, ECMAScript, ...) to convert each source file into a set of index terms for that source file, with index terms taken to be langauge elements such as specific keywords ('for', 'begin', ....), string literals (of whatever several varieties might exist in the langauge), variable names, operators, comments. Whitespace is ignored as appropriate for each language. It handles ASCII, ISO8859-1 and Unicode based langauges. Using index terms for each file it builds a global index for a large source code base (tens of millions of lines).
A GUI offers you a query langauge for searches. You can find just strings containing abc:
S=*abc*
or constants larger than 20:
N>20
or for loops with a comparison to an upper bound involving an a variable postfixed with the name "Income"
'for' ... '<=' I=*Income
Search are often shorter than a second using the Linux kernal (1.5 MSLOC, 9500 files).
Hits on search terms pull up a list of lines containing the hits. Clicking a line pulls up the source text, properly tab-indented, with accurate line numbers (those of you that use GCC will appreciate this since GCC counts form characters oddly). Selecting EDIT takes you to your favorite editor.
EDIT 2/22/2010: It has recently acquired a command-line invocation method, so you can use it rather like grep.