When you switch tabs in the search results the search string gets lower cased. This normally doesn't have an impact on the search results unless you do a code:
search.
This can be worked around if you modify the url e.g. https://stackoverflow.com/search?tab=newest&q=code%3a%22fooBar%22
Can you not change the case of the query string when switching tabs and when doing code searches?