Gmail – How to Perform Wildcard Search

gmailgmail-search

Is wildcard search possible in Gmail?

Best Answer

Not in general, no.

The Gmail search functionality works based on what I would describe as tokens. A token is any sequence of alphanumeric characters separated by a space or by other non-alphanumeric characters such as underscore, full stop (period), "@", dash, etc.. So in peter.ford23@example.com there are 4 tokens: "peter", "ford23", "example" and "com".

Wildcards within tokens do not work. Wildcards outside of tokens are unnecessary and misleading.

Imagine you wish to find messages from peter.ford23@example.com and tried these examples:

from:(pete*)

... would not work

from:(ford23@*)

... would work, but is misleading. It is no different from searching for "from:ford23".

If you thought that Gmail was checking for the "@" symbol immediately after "ford23", you could try this instead ...

from:(peter@*)

... should not work, but does!

`

One example given in another answer is

subject:(jefferson-*)

... but again, Gmail is inadvertently misleading us. The dash and asterisk characters have no effect. (You can remove them and then remove the brackets too. It's the same as searching for "subject:jefferson".) It would return an email with subject "meeting with jefferson.jones".

subject:(jefferso*)

... would not return an email with subject "jefferson-school"

subject:(jefferso*-*)

... would not return an email with subject "jefferson-school"

`

There has been a suggestion that Perl regex can be used. I will not address that suggestion here, except to repeat that wildcards within tokens do not work (even using Perl syntax). And wildcards outside of tokens are unnecessary and misleading.

`

Disclaimer: For the sake of brevity I have used uncertainty-free language above. But I do not work for Google and I am not 100% sure of every claim in this answer. I do believe it is one of the best answers so far though. Google's own Gmail search operators help page doesn't mention wildcards.