Thursday, 05 October 2006

Google Labs has deployed Google Code Search, which allows regular expressions to be used to search public source code on the Internet. You can also restrict searches by language, license or filename. Earlier this year, Krugle launched a source code search engine, too. I'll need to think about the potential IP, license and security implications of this (there are many software licenses being used in the world, so how do they respect those that don't allow republication, for example, or what if they don't detect a license in the crawl?), but I suppose if it's out there, it's out there. At any rate, it's interesting what you can do. I bet a lot of people will get a lot of mileage out of this:

Google crawls as much publicly accessible source code as their system can find, including archives (.tar.gz, .tar.bz2, .tar, and .zip), CVS repositories and Subversion repositories. And there's also a GData API available to allow mashup apps access to the functionality.

Syntax and Examples (more about regexp syntax)

Search for a regular expresion
go{2}gle hello,\ world ^int printk

"exact string"
Search for exact string
"compiler happy"

Search only in files or directories matching regexp
file:\.js$ XMLHttpRequest file:include/ ioctl
file:/usr/sys/ken/slp.c "You are not expected to understand this."

Search packages with names matching regexp.
(A package's name is its URL or CVS server information.)
package:perl Frodo package:linux-2.6 int\ printk

Search only for programs written in languages matching regexp
lang:lisp xml lang:"c++" sprintf.*%s

Search only for files with licenses matching regexp.
license:bsd int\ printf -license:gpl quicksort

(via Google Blogoscoped)

Add/Read: Comments [0]
Thursday, 05 October 2006 06:00:53 (Pacific Standard Time, UTC-08:00)
#  Trackback

Referred by: [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral] [Referral]
21 ( [Referral]

Comments are closed.