Gmail lets you combine search conditions, alternatives, and exclusions. Build the query in stages and inspect the individual matching messages. A conversation can appear because one of its messages matches, even when other replies in the same thread contain excluded material.
Start with conditions that must all match
Try from:alex@example.com has:attachment newer_than:1m for recent attachment-bearing mail from a known sender. Each added condition narrows the search. You can use the documented AND operator when explicit grouping improves readability.
Run the short version first, then add the next condition. This makes a typo or an incorrect assumption easier to identify than pasting a long untested query.
Add alternatives and exclusions carefully
{from:alex@example.com from:sam@example.com}uses alternatives.subject:invoice -subject:draftexcludes a subject term.has:attachment -filename:jpgcan help narrow attachment candidates, but still requires inspection.
Use parentheses where you need to group terms, and uppercase OR for a clear alternative expression. These are Gmail search conditions, not a general programming language or regular-expression engine.
Check thread behavior and search scope
Google specifically explains that a negative search can still display a conversation containing an excluded-looking message if another message meets the query. Open the thread and identify the matching item before concluding that the operator is ignored.
Ordinary search excludes Spam and Trash. Add in:anywhere only if the investigation needs those locations. Remove unneeded search chips or earlier conditions if the visible results seem unexpectedly narrow.
When a query will support a bulk action, compare several positive examples and several messages that should not match. A plausible-looking first page is not enough. Save the working query as a reference before creating a filter, and begin with a harmless label-only action if automation is needed. Search itself is reversible and non-destructive; deleting, forwarding, or skipping the inbox is a separate decision.
Browse Gmail & Google Account help
References
Reviewed against the linked product guidance, standards, and identified vendor or public-authority guidance on October 29, 2026. Available options and screen labels can vary by account, device, region, and organization policy.