News for hackers. Stuff that matters.
Re:Ask HN: How do you search for "-42" in Google? by narb on Monday February 21, 2011 @09:48PM (#2248459)
Punctuation is generally ignored in searches (some exceptions: _, +, $ and # in limited contexts, e.g. "C++", "$1000000" and "F#"; the calculator; word separators, e.g. "a=b", "a/b", "a}b", etc.; Google Code Search)

http://www.google.com/support/websearch/bin/answer.py?answer... http://www.google.com/support/websearch/bin/answer.py?answer...

Re:Ask HN: How do you search for "-42" in Google? by SpookyAction on Monday February 21, 2011 @05:43PM (#2247623)
Also, how do you search for anything with punctuation? I frequently use Perl, which makes use of punctuation for functions, and am constantly frustrated on how you can't search Google for them. Try searching for "perl $!" and you won't get any pages referring to Perl's error handling function. Not even results referencing Perl code that uses it. Google just ignores it.
Re:Ask HN: How do you search for "-42" in Google? by win_ini on Monday February 21, 2011 @11:23PM (#2248724)
C'mon...you've now gotta tell us why you were searching for "-42"...
Re:Ask HN: How do you search for "-42" in Google? by sophacles on Monday February 21, 2011 @04:39PM (#2247314)
Similar question for command line options in unix. :)
Re:Ask HN: How do you search for "-42" in Google? by _delirium on Monday February 21, 2011 @05:00PM (#2247409)
In GNU tools at least (not sure if others follow this convention?), the option '--' indicates that subsequent parameters aren't to be interpreted as options. For example, this lets you cd into a directory named '-foo':

   cd -- -foo
Re:Ask HN: How do you search for "-42" in Google? by eklitzke on Monday February 21, 2011 @05:06PM (#2247453)
This is a feature of GNU `getopt`, and I think it's supported by most BSD getopts. It's also recommended behavior by the SUS, see guideline 10: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_...

So it's not mandated, but it's the behavior of nearly all modern UNIX systems.

Re:Ask HN: How do you search for "-42" in Google? by sophacles on Monday February 21, 2011 @07:24PM (#2247995)
This is useful to know, and a great tip! I actually meant that "the OP question applies to searching for info about command line options as well". I find it amusing how your interpretation is equally valid. There is a lesson about clarity of communication here. :)

(also thanks for the reply, I appreciate it even tho it wasn't what I was looking for)

Re:Ask HN: How do you search for "-42" in Google? by thewordpainter on Tuesday February 22, 2011 @11:11AM (#2250270)
this reminds me of the worst band name of all-time: !!!

they're actually fairly popular for those that aren't familiar, but i can only imagine how many potential fans they've lost because you can't readily find their online presences.

Re:Ask HN: How do you search for "-42" in Google? by qntm on Monday February 21, 2011 @05:59PM (#2247683)
I'm reasonably sure that Google doesn't index punctuation marks.
Re:Ask HN: How do you search for "-42" in Google? by il on Monday February 21, 2011 @06:25PM (#2247783)
Actually, a big point of pride for Google in the early days was that you could search for "C++" and get relevant results.
Re:Ask HN: How do you search for "-42" in Google? by Rhapso on Monday February 21, 2011 @06:30PM (#2247805)
do search for negative 42. spell the word out. if you are lucky then google will pick up the integer -42 as a synonym and search it too.
Re:Ask HN: How do you search for "-42" in Google? by ksolanki on Tuesday February 22, 2011 @12:51AM (#2248936)
search for minus 42.
Re:Ask HN: How do you search for "-42" in Google? by clintcparker on Monday February 21, 2011 @05:15PM (#2247510)
"-42"
Re:Ask HN: How do you search for "-42" in Google? by _delirium on Monday February 21, 2011 @05:33PM (#2247588)
That doesn't actually work, but for different reasons: Google drops the punctuation and just searches for "42".
Re:Ask HN: How do you search for "-42" in Google? by staunch on Monday February 21, 2011 @05:31PM (#2247580)
The - is ignored it seems.