0

Currently, Stack Overflow has a powerful search capability which is very useful. But I believe it could be even more useful, given that so many of it's users are working in highly technical fields, such as software development. For example, I came across some C++ code that uses an operator with which I'm not familiar:

bool lessthan = !!greater(N);

I looked at a C++ reference site for information on operators, and didn't find any operator like '!!'. I cannot search for posts about this operator on SO, using 'operator !!', because the !! gets stripped as irrelevant punctuation. So I end up getting all the posts which use the word 'operator'.

I have run across this problem before with other significant symbols that are stripped as punctuation. It would be great if there was a way in SO searches to say 'search for this string of characters as-is'. But I suspect that these characters have already been stripped from the entries in the search index...

Also, given that search in SO allows for boolean operators, such as 'and' & 'or', how can someone say they want to search for posts about the use of these boolean operators in C++?

Can something be done about this? Or is there already some (secret?) way of searching for symbols that ordinarily are stripped as punctuation?

5
  • The Help Center's page on searching is wrong about this. It says you can do this by putting the search in double quotes, (giving the example "<%#"), but neither "!!" nor "<%#" return any results for the reason you mentioned. However, there is a code: keyword that allows you to do this, like code:"!!" will do it, though I found that out from the dupe meta post a while ago, I don't see it anywhere in the help center.
    – Davy M
    Commented Jan 24, 2018 at 16:18
  • I dispute the designation of the "How to search for dollar sign or exclamation mark?" post as duplicate. Looking through that post, I see that the issue is not yet resolved. The page on searching is still in error and doesn't describe the use of the code: keyword. Meanwhile, there is still no mention of using SymbolHound for this (the real solution in my case, since I'm looking for any discussion of the symbol, whether in code examples or not). Commented Jan 24, 2018 at 18:28
  • Turns out, according to why-arent-we-told-we-can-use-special-characters-in-search, SymbolHound is not really that effective. And this problem of searching has also been noted in search-using-symbols-is-broken Commented Jan 24, 2018 at 18:41
  • Thanks, @rene, that was helpful in answering my ultimate question. I guess I have to trust that any answer that I need regarding a symbol will have used that symbol in code (otherwise I'm outta luck). Commented Jan 24, 2018 at 21:00

0

Browse other questions tagged .