Following code contains a custom function to get the search keyword and just pass your URL to this function as a parameter.
Note: This is only applicable to URL search, that is it will only return what we have typed in google or any other search engine.
public string getSearchKeywords(string strQuery)
{
string result = "";
string pattern = @ "\b\w*p=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*q=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*qs=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*" +
@ "|\b\w*encquery=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*k=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\\b\\w*qt=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*" +
@ "|\b\w*query=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*rdata=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*search_word=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*" +
@ "|\b\w*szukaj|terms=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\\b\\w*text=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*wd=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*|\b\w*words=[a-zA-Z0-9%~@#$^*()_+=[\]{}|\\,.?: -]*";
foreach(Match m in Regex.Matches(strQuery, pattern))
{
// collect all text
if ((m.ToString().IndexOf('q') == 0 && m.ToString().Contains("q=")) | (m.ToString().IndexOf('p') == 0 && m.ToString().Contains("p=")) |
(m.ToString().IndexOf("encquery") == 0 && m.ToString().Contains("encquery=")) | (m.ToString().IndexOf("rdata") == 0 && m.ToString().Contains("rdata=")) |
(m.ToString().IndexOf("search_word") == 0 && m.ToString().Contains("search_word=")) | (m.ToString().IndexOf("szukaj|terms") == 0 && m.ToString().Contains("szukaj|terms=")) |
(m.ToString().IndexOf("text") == 0 && m.ToString().Contains("text=")) | (m.ToString().IndexOf("wd") == 0 && m.ToString().Contains("wd=")) | (m.ToString().IndexOf("words") == 0 && m.ToString().Contains("words=")))
{
result = m.ToString();
}
}
if (result != "")
{
result = Regex.Replace(result, @ "[^a-zA-Z0-9~@#$^*()_+=[\]{}|\\,.?: -]|[%20]", " ").Replace('+', ' ').Substring(result.IndexOf('=') + 1);
result = result.Replace(" ", " ");
}
return result;
} Input: https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF- 8#q=how+to+extract+zip+file+without+passwordOutput: how to extract zip file without password.