Google Unveils Code Search
derek_farn writes, "Google now has a page that supports source code searching. I hope they extend it to be more programming-language aware (e.g., search for identifiers and functions) like the specialist code search sites (Krugle, Koders, and Codease), who probably now have very worried investors. I don't see any option to search for Cobol. I guess there is not a lot of Cobol source available on the Internet, even although there is supposed to be more Cobol source in existence than any other language (perhaps that statement is not true in the noughties)." From the Cnet.com article: "Google engineers, many of whom participate in open-source projects, already use these code searching capabilities internally. Since it is a Google Labs project, the company is not yet seeking to monetize searches through ads."
At last we can use regexps and search on all the important characters between the alphanumerics! For example the prefixed '@' in PHP - very hard to figure out what this is, without reading the reference cover to cover. Now at least we can search the codebase and hope to see some useful comments preceding it, or figure out from context what's going on.
e.g. "@fopen file:.php"
all bugs are shallow."
C sif%5C(%5B%5E)%5D*%5C)%3B+license%3Agpl+lang%3Ac%2 B%2B&btnG=Search
Well, it looks like that's not really the case: http://www.google.com/codesearch?hl=en&lr=&q=++%5
I hope this service will help improve code quality...
Mmmmm, SQL injection for the world to see. Good Call.
Come as you are, do what you must, be who you will.
According to the help / FAQ page, they are searching cvs & subversion repositories.
You can also find some unfunny stuff too!
This could be abused by email spammers.
Search for: http://www.google.com/codesearch?q=%40
This reveals a lot of email addresses in code.
It's giving the spammers email addresses on a plate. (within a geek targeted audience)
That's definitely not funny but scary.