Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is wildcard search possible in Gmail?

share|improve this question
up vote 8 down vote accepted

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:


... would not work


... 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 ...


... should not work, but does!


One example given in another answer is


... 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".


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


... 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.

share|improve this answer

You can use Perl regex in both the find and filters if you wrap it in a forward slash.


Will match everything from the hp.com domain.

It gets complicated very quickly because you have to escape certain characters.

Here's one I use that matches multiple address and compresses several rules down to one:

Apply filter Media

That will label notification emails matching:

share|improve this answer
Has anyone been able to get this to work? I'm using Google Apps, and it doesn't seem to work in either the filter or search. The only reason it does seem to work is because google discards symbols so your query from:(/(hp\.com$)/) is becoming from:@hp.com. The reason | works is because it acts as the OR operator. @Turtle: do you have any links to documentation of the feature? – Senseful Jul 9 '10 at 17:06
Unfortunately, this doesn't work. Tested on both Gmail and Google Apps. – Senseful Aug 29 '10 at 3:50
I am not able to get this to work either. – CoatedMoose Sep 23 '12 at 22:21
@StefanLasiewski @Senseful @CoatedMoose I just tested this in both Gmail and Google Apps and it worked perfectly. Be sure to enter your search string in the main search field, not the labeled fields in the drop-down menu. For instance, I edited an existing filter, pasted in a regex search string, and clicked 'Continue.' The result was that the main search string was populated with a string beginning from:(from:(… If you are still unable to get this working, please post an example of a search string you tried. Getting the syntax right is very important. – Todd Prouty Jan 30 '13 at 5:49
I take it back. It does work. I just tried to search for 6 web & database hosts, and it works for me: from:(/\@web1|web2|webdev|db1|db2|dbdev\.example\.org$/) – Stefan Lasiewski Jan 30 '13 at 20:19

No it is not possible. However, it depends on what you need it for. Gmail uses a very limited form of stemming based on whole words.

For example, let's see if I can retrieve emails from phwd.lastname@gmail.com

from:phwd - works

from:pwhd.l - nope

from:phw - nope

So the closest you will get in this case, is if the person was nice enough to cut their first name and last name by the period.

so phwdlastname@gmail.com will result in all of the above searches not working.

But say I was nice to fill out my contact information and have my display name as "phwd lastname" then I can at least retrieve it this way


from:"phwd lastname"

It sucks but at least we have Gmail Ninjas .

share|improve this answer
This page has some info. – Lazer Jul 8 '10 at 19:21
I wrote a detailed blog post about this, in case anyone wants more information. – Senseful Oct 25 '10 at 21:34

According to Berkeley Lab Commons:

Gmail search does not implement sub-string, partial word, wildcard, or regular expression searching.

Your only alternative is narrowing things down with Advanced Search or trying multiple, simultaneous options in the search box

share|improve this answer
+1 thanks Ivo for that, sometimes I have some misspelled words in emails and was hoping for some solutions for this. I will leave the question open for another day in case someone come with a work around solution for this – kristof Jul 8 '10 at 16:59
How funny! I work at Berkeley Lab and I was an early adopter for the Berkeley Lab Google Apps implementation, and I was part of the discussion behind that FAQ. I have a slightly different take. See my answer below. – Stefan Lasiewski Nov 11 '13 at 16:55

A bit easier, just write the following in the search box:

from: (*@mysite.com)

share|improve this answer
While this is correct for full pre-domain searches, it isn't a true wildcard meaning that wordpress@domain.com wouldn't get found from a search like from:(word*@domain.com). – Dez Oct 22 '12 at 18:20
As per my answer, I believe the * and @ do not have the intended (or any) effect. So this search will match against everything you expected it to, and potentially against some extra stuff. – Peter Ford Oct 8 '14 at 1:38

Wildcards are not officially supported in Gmail, even if they are supported in Google Search.

That said, I have been using wildcards to match hostnames and subject lines, and I have been doing this for 5+ years. However, since wildcards are an unsupported feature, the behavior changes from time to time. Filters that once worked will stop working after Google changes Gmail. In addition, filters used with Gmail in Google Apps may work differently then filters in standard Gmail (outside of Google Apps).

The following examples work for me in Gmail for Google Apps.

For example, until Oct 2012 I was able to use the following search to match emails sent with the from line of "example@example.org" or "example@*.example.org" (where the latter was email sent directly from root@host.example.org, for example).

from:(example@example.org OR example@*.example.org)

But in October 2012 this filter suddenly broke. But now I can use the following search with the same results:


Also, I can use a wildcard in the subject line. The following filter will match emails with a subject like: [jefferson-school-pta] Important information from school principal:

share|improve this answer
As per my answer, I believe that searching for subject:(jefferson-*) is the same as searching for subject:jefferson so any apparent success with wildcards is a red herring. – Peter Ford Oct 8 '14 at 1:42
Perhaps the algorithm has changed, but at the time of my email, subject:(jefferson-*) and subject:jefferson would return different results. ``subject:jefferson` would not match jefferson-school-pta. – Stefan Lasiewski Oct 8 '14 at 3:45

I know it's not the most straightforward solution, but with Mozilla Thunderbird asterisk wildcard will work. For example searching *top* will find anything containing partially or totally that string, for example Stop or TopGun.


share|improve this answer

No, it's not possible. The search in Gmail does not allow substring search.

share|improve this answer
Adding a link to backup your claim will help. – Dez Oct 23 '12 at 0:45

Here is Google's Advanced Search Tips page: http://mail.google.com/support/bin/answer.py?answer=8931&topic=41

In general there is no need for a wild card. You can simply search for 2 word or word parts with a space in between them and you will get any emails that contain the 2 words whether they are both found within the same word or not.

share|improve this answer
thanks for the link. I am not sure about the second part of your answer. Do you suggest that searching for 2 words: gen eral; would return emails that contain "genaral"? – kristof Jul 8 '10 at 17:05
maybe he meant phrase. I tried that and it did not work. – phwd Jul 8 '10 at 17:10
@Kristof: Yes that is what I meant. – Ben Hoffman Jul 8 '10 at 17:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.