Eudora Tip #201/15-Oct-2003
Matching City Names
Bob Williams brings us the final part of his Tip for using Regular Expressions.
Bonus Example 4
Since we’re having so much fun, here’s a bonus example. Let’s once again play the role of the Phoenix real estate agent. Now, however, instead of looking at zip codes, we’re looking at the city names, and want requests in Phoenix, Chandler, or Paradise Valley, as well as still wanting only new homes. We can cover this easily with Eudora’s conventional match criteria, but not within just one filter. To do it in a single filter requires regular expressions. So, we use the first criteria to match new homes, and the second to match our city options.
The expression we want is: (Phoenix|Chandler|Paradise Valley)
This one is easy to interpret if you read the ‘|’ character as ‘or’. The parentheses are there simply because they are required when using the | operator — you just put them around all your options.
Conclusion
This tip only touches the surface of the power that regular expressions offer. If you’re interested in really learning regular expressions, the O’Reilly book Mastering Regular Expressions, by Jeffrey E. Friedl, is considered the definitive reference.
Also of note is that Eudora 6.0 supports using regular expressions as search criteria within the search window. With a few minutes of thought and the examples from these Tips as inspiration, you’ll quickly see how much more useful this makes the search feature. You may not need regular expressions often, but when you do need them, you’ll think they’re the best thing in the world.
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 Four useful please visit Bob’s website. My thanks go to Bob for his contribution.
Thanks for reading. Remember to tell your friends about MacTips. Subscribe for regular Tips.






Add your Comment