NOTE: This list is almost entirely copy/pasted from THIS awesome article. I've made my own personal edits (adding some additional content) which is why I keep it here.
Ohloh Code says it is one of the largest and more comprehensive code search engines with more than 10%2B billion lines of code indexed and updated FOSS software directories. We did give it a mention when Danny showed us how to enhance our coding skills by contributing to an Open source project. Ohloh is the upgraded face of Koders.com and is also freely available and freely editable by its community. It indexes all text files for search and has syntax highlighting support for 43 programming languages. The search query syntax supported by the service gives you the flexibility to search for different code classes. The search engine presently does not support regular expressions.
Krugle is an open source search portal which taps into open source search repositories like Apache, JavaDocs, and SourceForge among others. You can search for code in C%2B%2B, Java, Perl, Python, SQL, Ruby, XML, HTML etc. It is powered by OpenSearch. Krugle also has an advanced search feature that can help you narrow down to the right APIs, libraries, sample code or documentation. From the results page, you can browse to the project developed with the code.
SearchCode sifts through 16 billion lines of open source code from code repositories like GitHub, BitBucket, CodePlex, SourceForge, Fedora and more. The code and documentation search engine is maintained by a single developer. You can use filters like file extensions, specific repo name and URL, regular expressions, and special characters. Specific examples and documentation search support is listed on the Examples page.
You can also search for documentation; you can do a comparative search to visualize on how many domains a term appears; and you can do a competitor analysis by checking which websites have their code. NerdyData has a free basic plan which lets you do 200 credit searches. Each search feature has a credit score attached to it. You can check out the three pricing plans and try it out with the free features first.
Google and other search engines aren’t that good when it comes to searching with special symbols. Google for instance, strips away many punctuation marks and special symbols, if not all. Google does recognize some and here’s a list which you can refer to. So, searching with regular search engines might not return the desired output if you are searching for variable or error codes with special characters. Symbol Hound is an alternative search engine that can help here.
Merobase is a different kind of search engine that helps you search and locate software components. Merobase does search for source code, but it also – and more importantly – can search for software components which are the discrete building blocks of software. It is a module that packages a set of functions. Component-Based Development (CBD) involves the creation of software from pre-written components. Merobase can search for interfaces with simple text based queries. You can also search with function-based, object-oriented, name-based, and test-driven queries. This abstract search method is a highlight of this engine. Merobase searches for components written in Java, C%2B%2B, and C Sharp.