views:

1007

answers:

9

So let's say I have an issue with some code and I want to use google to help find a solution. So I paste a code snippet into the search bar. Google will ignore any special characters like operators (especially the '.' operator), returning results that aren't as relevant as I'd like. This is true even when encasing it in double quotes. It's also annoying when trying to use something like 'C#' as part of a search. Does anyone know of a search engine that respects your special characters?

+1  A: 

I think that you should have a look at google codesearch

jumar
A: 

Edit: I tested with http://code.google.com, not http://www.google.com/codesearch - odd that they don't return the same results.

Google code search doesn't work either - searching for something like "cs[i]" brings back hits for "csi".

I really doubt there's any general-purpose searching tool that takes programming syntax into consideration - it's just much too specialized. There may be search products/appliances out there, but they're likely to be pointed at private codebases, not intended for public search.

Greg Hurlman
+2  A: 

Also you should try using quotes around things with sensitive characters like the +.

Searching for $i++ found 0 results.
Searching for "$i++" found 707,000 results.


@Greg

Using Google Code search with cs[i] results in 2,450,000 results and finds strings with csi
Using Google Code search with "cs[i]" results in 74,700 results and finds strings with cs[i]

Joseph Pecoraro
+2  A: 

Unfortunately, it seems workarounds are in order. I've found that searching for csharp or c sharp seems to be necessary. I've also used "Ansi C" or "c99" to search on C instead of C++.

I know google code search seems to suffer the same issues, although it does have a regex engine.

Neil Neyman
+2  A: 

On krugle, a search for "cs[i]" in quotes seems to work... as it does also in google codesearch...

jumar
A: 

What about Koders?

Joril
+3  A: 

I see a number of specialized code searches, but they all miss the point. I don't want an engine that only indexes submitted code snippets. I want an engine that indexes the entire web (at least, in the same sense that google or yahoo do) and will allow me to use special characters in the search.

Joel Coehoorn
A: 

" Google will ignore any special characters " !!! And all other search engines apparently are just as bad now. Even ALtaVista advanced, which used to find these i9s brain demmaged too.

It sure saves them indexing time, but if I try to find something like email addresses at some company say "@comcast.com" it ignores "@" and brings thousands of useless pages.

There are many other occasions, when ignoring special characters makes Google and other search engines utterly useless. Very frustrating!

Any search engine that does not ignore these?!!

A: 

the firefox search box strips some special characters, particularly the # from C#. Googling direct does not

Colin Pickard