How can I search for a string containing a colon?
Searching for non-word character sequences (which are operators in many languages) feels like it should be a doable thing on SO, yet a simple search for
++ yields no results.
It makes sense for general purpose search engines to optimize these strings away, but this is a programmer's site. You should be able to search for anything in a programming language.
Try it for yourself:
!!, or even most non-word characters by themselves.
So, is there an update? Is this a feature we can expect soon?
This same topic was approached and answered briefly by Jeff Atwood here:
- Is it possible to search for punctuation/special characters?
- How can I search for a string containing a colon?
In each case implying that SO's search engine was probably backed by Google. Google seems to optimize away character sequences like these, so a direct solution is out. But why not encode characters for the sake of the search index?
An efficient way to do it would be to scan each page for the character sequences
/[\w\s](\W+)[\s\w]/ and then add them in an encoding to a meta tag. Then have the search also look for the encoded version of similar sequences found in search strings.
This shouldn't break any existing functionality if a simple encoding like url-encoding is used, but if a smarter encoding such as
plusplus is used, then the search can also operate in natural language across SO and other search engines.