Eudora Tip #198/24-Sept-2003
Matching Joe Cool
In previous Tips (search the Archives) I’ve written about making Filters for Eudora, but the trouble with Filters is that they are so finicky. If Joe Cool sometimes sends email from one address and sometimes from several others then I probably have to make two or more separate filters to catch his emails. Until Eudora 6, that is.
When Bob Williams mentioned Eudora’s new capabilities in passing on the TidBITS Talk mailing list I asked him to write a small Tip for us.
Bob responded quickly and cheerfully and has kindly written an extremely useful and thorough Tip for using Regular Expressions. Here’s Part One. The next few Tips will bring the other Parts.
With the release of version 6.0, Eudora’s filters have learned an extremely powerful new trick: regular expressions, which are accessible via the “matches regular expression” match criterion in the Filters window. A regular expression offers a way to represent a string of text in the filter such that parts of the string can change, but it will still be recognized. It accomplishes this feat by using special symbols, called meta characters, to represent parts of the string. For instance, the ‘.’ (period) character can represent any character, including a return character. A list of the special characters that Eudora supports can be found on pp. 209-210 of the user manual. I recommend you read those pages.
So, what can a regular expression empower a filter to do that it couldn’t previously do? Let’s look at a few examples.
Example 1
Some people send out e-mail with a variety of closely related addresses, perhaps because they’re using different machines at their place of school or work. For our example, let’s say that Joe Cool sends out messages from his school with <joe_c@cs.example.edu> or <joe@cs.example.edu> as the return address. While this situation could be covered with a couple of Eudora’s conventional match options, it can also be done with a single regular expression: “joe(_c)*@cs\.example\.edu”. The interesting part there is “(_c)*”. The ‘*’ character says that the previous item must appear zero or more times, which is to say that it can optionally appear. Since * only applies to the smallest previous item that it can (usually a single character), and we want to bind it to a pair of characters, we put parentheses around the pair; without the parentheses, the * would only look for the ‘c’ character to repeat zero or more times. You may have also noticed the ‘\’ character before each period in the address. From above, you know that . can represent any character, but since we really do want it to be a period in this case, we insert a \ before it to tell Eudora to interpret it as a plain old period, and not a regular expression meta character. If you forget to do this, your expression may work in unexpected ways.
Robert E. Williams, Jr.
President, TriVectus, LC www.trivectus.com
Visit our site to learn about our web consulting services, and to download our freeware and shareware software and desktop pictures. Also, be sure to sign up for our new newsletter, Overture, which will help you increase your site’s ROI.
If you’ve found this Part One useful please visit Bob’s website and be sure to read Part Two next week.
If you found this Tip useful you definitely need my ebooks Sizzling Safari Tips for Mac Users & 22 Tempting Timesavers for Mac Users. And remember to subscribe for regular Tips.






Add your Comment