views:

72

answers:

1

Questions:

How do you search for non-alphanumeric characters when using Google?

Why doesn't Google always interpret strings enclosed within double-quotes literally?

What is Google's escape character e.g. how would I search for something that contains a double-quote?


Backgound:

I am currently learning Grails. I was reading Mastering Grails: Grails services and Google Maps (which is very good tutorial series BTW) when I came across the following line of code:

def result = [:]

By looking at the surrounding code it seems like result is defined to be some kind of map, but I wanted more information on what precisely "=[:]" does.

How do you Google something like this?

I tried searching for:

grails "[:]"

but this returns the same result set as searching for "grails".

That happens because searching just for:

"[:]"

does not return any results.

Thanks for your time!

A: 

[:] is an empty map in Groovy

You can learn more about maps and collections here or focus on Groovy maps.

I think you are assuming that Google is going to do a simple 'grep' where their infrastructure is more setup to search based on a linguistic model.

You might try Google Codesearch

I would encourage you to pull up the Groovy Console (groovyConsole on the command-line if you have groovy setup) and play around with maps and lists to get the hang of it.

Colin Harrington
Thanks @lael for pointing me to the documentation! My questions about using google remain though :( Are you saying google does not index the non-alphanumeric characters at all? I always thought search strings enclosed within double-quotes are searched for "as-is" (i.e. not applying any linguistic logic)?
Heinrich Filter
Colin Harrington
Aha, I see. Thant would explain it. Thanks for your time!
Heinrich Filter