I just discovered that a self answered question I wrote got deleted by a mod. The question I am referring to is: Why don't I find any expected results when google-searching with search terms that start with dashes?
I solicited discussion on meta.stackexchange about where and how to ask this question before posting it anywhere. You can find that meta discussion here: Where can/should I ask a question about how to google for command-line arguments that start with a dash?.
I wrote this question and its self-answer to help other people with I problem that I personally faced.
I'd like to understand why this question and its self-answer were deleted. Unless I missed it somehow, I did not get any explanation from the user who deleted this post about why it was deleted.
- Is the question off-topic here? Why was it deleted and not just closed then?
- Was the question and its answer of unsalvageably low quality?
The deleted contents are as follows:
Background: When I try to google search something like "
gcc -Wall" (for example,) to find documentation on the
-Wallflag's meaning for GCC, it looks like I get the same search results as if I just searched "
gcc": None of the results seem to include the text "-Wall" in them.
Why doesn't a search query with search terms starting with dashes seem to work as I intend (return results containing matches of the terms that starts with a dash), and how can I properly query for terms that start with a dash?
Note: Related, but not a duplicate (because it is more general, and the answer is binary-different as a result): How do I escape Google functional characters?.
gcc -Wallactually tells the Google search engine to include things that match "
gcc", and exclude things that match "
Wall". This is because the dash/hyphen character, "
-", is one of several special characters called "search operators" for the Google search engine.
If you go to "How to search on Google", it links to a page about search operators that documents the various search operators and how they work. For this particular one, if you start a term with a dash/hyphen, it will tell the Google search engine to exclude that term from the search. Quoting from the current user documentation:
Exclude words from your search
-in front of a word you want to leave out. For example,
jaguar speed -car
To properly search for pages with matches of search terms that start with a dash/hyphen, use the "exact match" operator: enclose/wrap the term that starts with dashes with double quotes (including the dash/hyphen), like "
The "exact match" operator does what its name suggests: It is used to search for exact matches, and can be used to treat the dash/hyphen as part of the search term for which to find an exact match. Quoting from the current user documentation:
Search for an exact match
Put a word or phrase inside quotes. For example,