Gmail – How to search Gmail with negation

gmailsearch

The application I maintain sends error emails to me, which contain a build number and a description of the failure. I want to be able to search for specific messages from specific builds but Gmail doesn't seem to handle this properly. I have tried:

NullPointerException 12B -12A

to find emails for NullPointerExceptions that occurred in build 12B, and exclude those that came from build 12A. This search returns all NullPointerExceptions that came from EITHER 12B or 12A. I tried various grouping operators and nothing seems to work.

If I just search for 12B -12A it correctly doesn't show any 12A emails, but as soon as I add "NullPointerException" it starts finding all the NullPointerException emails ever.

Best Answer

Try (NullPointerException AND 12B) -12A