I use Gmail and I'm receiving lots of emails I want to filter. They all have in common that the subject is like these:

Some words - r1234 - Some more words
Some words - r987665 - Some more words
Some words - r01 - Some more words

So, all of them have something like - r... - in the subject...

Is there any way to filter all those messages?

  • 5
    Unfortunately, Gmail doesn't support regular expressions, but you could look into some of the other solutions that answer provides. – John Bensin Sep 23 '13 at 11:23
  • What if you search for "Some words - r" " - Some more words"? – MrWhite Sep 23 '13 at 14:10
  • @w3d I don't understand what you mean... – MikO Sep 24 '13 at 11:29
  • 1
    Ah, do "Some words" and "Some more words" vary each time? In that case my suggestion wouldn't work. I perhaps wrongly assumed that these two phrases were consistent among these emails? (Also, just realised that gmail doesn't seem to like searching for part words, so "wor" wouldn't find "word"!) – MrWhite Sep 24 '13 at 15:08

Short answer

Gmail doesn't include search features such wildcards or regular expressions.


Use the Gmail API, Google Apps Script or third party application that include search features like wildcards or regular expressions.


Search in Gmail - Gmail Help

Filtering "From" with:

*@someemail.com OR *@someothermail.com

Works for me.

  • Question is about doing it with regular expression on subjects. – Mateusz Konieczny Jun 27 at 14:22

I haven't tried regex, but the current help doc specifies (with examples) the operators you can use to filter search results.


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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