Searching for code on the web is always a bit tricky, as search engines tend to ignore or mangle punctuation and other characters that are central to programming. The latest bit from Google Labs, Google Code Search lets you search public source code, even using regexps.
Pardon me while I drool over this.
You can also limit your search by language, path or file names, package names and license (clever!).
The obligatory vanity search yielded a slightly surprising result from emacspeak. Huh. Oh, well.
"Public source code" seems to mean mostly packaged code available on the web or in publicly browsable cvs repositories. I hope they'll include code posted on blogs etc. in the future.
Code searching elsewhere
Update: Jason Kottke likes to play around, too.