0

I have the FiltaQuilla add-on for Thunderbird (http://mesquilla.com/extensions/filtaquilla/) because I wanted to give myself the ability to move messages that match a date range AND the subject line of the message can match any words I specify. Matches are found using a JavaScript Regular Expression. The idea is that if any of the five phrases below are found, the email would then be placed in another folder.

Here is the filter I'm trying to set up:

/CST 205 | CST205 | CST205-01 | CST 205 Preparation | CST205-01_SP14/ig

It has moved a bunch of emails, but is leaving emails that it shouldn't. Below are the subject lines of emails this script shouldn't be leaving behind:

  • Re: CST205-01_SP14 Keep it up!
  • Re: Hiring for CST 205

Can you help adjust my script to avoid leaving those messages behind?

midoriha_senpai
  • 177
  • 1
  • 16

2 Answers2

2

Make it

/CST 205|CST205|CST205-01|CST 205 Preparation|CST205-01_SP14/ig

and it will no longer require blanks before/after the strings. Also, The first two expressions should be enough, the rest matches subsets of them anyway. And you could shorten them to

/CST ?205/ig
Bergi
  • 630,263
  • 148
  • 957
  • 1,375
  • Thank you, this script did work. However, it failed on a test case where I send myself an email with 5 spaces between "CST" and "205". Tenub's answer above passed all my test cases. I really appreciate your help! – midoriha_senpai Feb 13 '14 at 03:43
  • Yeah, for that you'd swap the `?` (optional) for a `*` (repeated) modifier. You should've posted your test cases in the question! – Bergi Feb 13 '14 at 03:50
  • Sorry about that, I made up the test cases after you both answered the question. I should have said in my description that I would be testing for more than what I listed, such as for multiple spaces. Thank you for pointing that out. – midoriha_senpai Feb 13 '14 at 16:20
1

Is there anything wrong with:

/CST\s*?205/ig

This would capture anything with "CST 205" in it with an optional number of spaces between the letters and numbers.

tenub
  • 3,386
  • 1
  • 16
  • 25
  • Your answer did the trick! I can't believe I forgot to consider the common thread between all my search terms. Rookie mistake, thank you for correcting me. – midoriha_senpai Feb 13 '14 at 03:46