Practical tips help you use Apple stuff   Subscribe through Feedburner

Subscribe by Email · Subscribe to the MacTips feed · Follow MacTips on Twitter. · Follow us on YouTube. · Join MacTips on Facebook.

Looking for something in particular? A simple search is your best bet:

Or try the Categories and Tags page.

Matching City Names

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 [...]

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.

See more from: Uncategorized

It's great to see you visiting again! Have you tried the free MacTips updates via RSS or email, MacTips on Twitter and our YouTube channel? There may be more Tips on this topic. We'd love your Comments too.

Tell us what you think.
Note: there may be a delay before your comment appears. I now approve all comments from new visitors, in an attempt to keep spam at bay.

Add your Comment

click here