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

I want to create a filter for messages that comes from x and has the subject either starting with y OR ending with z.

I know the process of creating filters, however how do I specify starting with y OR ending with z.

PS: Currently I'm using y | z which is working "halfway" because it selects either y or z.

To rephrase the question, what should I type in the Subject box?

enter image description here

share|improve this question
I think you're out of luck here. Filters don't allow for regex expressions and have very limited wildcard support. Apparently a lot of people would like such a feature, and you can suggest they implement it. – Al E. Aug 26 '11 at 16:58
what other wildcards do we have? – Pacerier Aug 26 '11 at 20:21
and does @Al works? – Pacerier Aug 26 '11 at 20:21
(Yes, "@Al" works.) Primarily just email addresses. *@google.com will capture any email at google.com. – Al E. Aug 26 '11 at 20:31
up vote 2 down vote accepted

I am not sure that I understand the question, but try:

from:x subject:y OR subject:z -subject:(y z)
share|improve this answer
That's not exactly what the OP wants. He wants something like from:x subject:y other text in subject OR subject:other text in subject z; where y and z can be anything. – Alex Aug 30 '11 at 5:30
Pacerier, ignore the boxes and try putting the query into the "has the words" field. As for the query itself, Gmail doesn't support wildcard searches at this time so you can't specify whether y or z are at the beginning or end of the subject. "subject:y OR subject:z" will turn up everything that has either y or z in the subject. "subject:y OR subject:z -subject:(y z)" will turn up anything that has only y, or only z, but not both y and z. – Sarah Price Sep 1 '11 at 1:50
@Alex. Yes, Google really needs to buck up on better search operators. And we'd thought it's supposed to be a "search" company.... I can't even search for messages with a hyphen "-" in subject. – Pacerier Apr 25 '14 at 9:43

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.