<< Click here to Goto HomePage


Thursday, October 05, 2006

Search Source Code using Google

Public source code is now a few keystrokes away. This thanks to Google Search Code, the latest search service introduced by the Mountain View Company. Function definitions and sample code are instantaneously accessible via searches comprising regular expression syntax. “Google Code Search supports POSIX extended regular expression syntax, excluding backreferences, collating elements, and collation classes. To search for a space character, escape it with a backslash, as in hello, world. You can search for literal strings by enclosing the strings in quotation marks, as in "hello, world". We also support Perl extensions d, D, s, S, w, and W” read a Google FAQ made available. In fact, Google Code Search Frequently Asked Questions provides the basic instructions and answers necessary to clarify the service's search process.

The service is designed to crawl public code available via open-source projects, but also web page code and compressed code in .tar.gz, .tar.bz2, .tar, and .zip format archives, CVS and Subversion repositories. Google is not concerned with plagiarism, or copyright infringement. “Most of the code is open source so you can reuse it. But I don't think that's the primary use--it's more about how to learn about things and, when you're building open-source packages, to make sure you doing it the right way,” said Google product manager Tom Stocky.

Stocky also declared that Google Source Code delivers a service to filter, search and index billions of lines of computer source code and a way for a developer to identify and access snippets of reusable software. “For a long time it has been sort of an unsolved problem,” added Stocky. “It is hard to find references to this sort of data.”