Google Code Search
Google Code Search is a new search engine created by Google that "helps you find function definitions and sample code by giving you one place to search publicly accessible source code hosted on the Internet". You can restrict your search to a certain language, license, file or package. You can also use regular expressions, so don't forget to escape characters like space (for example, for\ \(;;\)).
Google does a good job at finding duplicates, and locating a file in a package.
Related:
Krugle, search open source code