advertisement

Listen Print

Demystify Regular Expressions

by Derrick Story
Network Newsletter for 08/26/2003

Dear Reader,

Regular expressions are at the heart of every text-processing application. This mix of symbols and text can be used to facilitate efficient, and even creative, programming.

However, for many, writing regular expressions is considered somewhat of a black art, often involving lots of trial and error to achieve desired results. O'Reilly author, Tony Stubblebine, has published an article titled, "Five Habits for Successful Regular Expressions," where he explains how developers can eliminate lots of guesswork by following five basic rules for nearly any regex implementation.

If you like what you read, you should consider taking a look at Tony's new book, the "Regular Expression Pocket Reference." It's a comprehensive guide to regular expression APIs for C, Perl, PHP, Java, .NET, Python, vi, and the POSIX regular expression libraries.

This is your opportunity to take the mystery out of regular expressions.

Until next week,

-Derrick

Derrick Story
O'Reilly Network Managing Editor

To subscribe to the O'Reilly Network newsletter (or other newsletters), visit https://epoch.oreilly.com/account/default.orm and select the newsletters you wish to receive in your user profile (you'll need to log in with your existing O'Reilly Network account -- if you don't yet have an account, you'll need to create one).

To change your newsletter subscription options, please visit https://epoch.oreilly.com/account/default.orm and click the"Manage My Newsletters" link. For assistance, send email to

Featured Articles

Five Habits for Successful Regular Expressions
For many programmers, writing regular expressions is a black art. They stick to the features they know and hope for the best. Tony Stubblebine, author of Regular Expression Pocket Reference, says programmers can avoid a lot of trial and error by adopting these five habits for regular expression development. The code examples in this article use Perl, PHP, and Python, but the advice Tony espouses is applicable to nearly any regex implementation.

Scanners and Mac OS X
Seems like the drivers for legacy flatbed scanners were at the bottom of manufacturers' lists for Mac OS X conversion. The wait was so long that many users just gave up hope. But over recent months new drivers from Epson, Canon, HP, and others have quietly appeared. David Weiss provides a helpful update to the state of scanning on Mac OS X.

Open Directory and Active Directory, Part 3
In this third and final part of Michael Bartosh's series on Mac OS X's Directory Services architecture, he looks at data. If you haven't read part one and two yet, you should take a look before reading this final installment.

Cooking with Cisco, Part 2
In this second installment in a two-part series of recipes excerpted from Cisco Cookbook, author Kevin Dooley shows you how to use a little-known IOS feature called IP Multicast Helper, as well as a simple way to ensure that your routers never send unimportant messages.

Globalizing and Localizing Windows Applications, Part 1
With the explosive growth of the Internet and rapid globalization of the world's economies, the earth is getting smaller and smaller. The applications that you develop for a local market may soon be used in another country. If the world used a common language, that would make the life of developers much easier. However, reality is far from perfect. Wei-Meng Lee shows you how to make your applications ready for the global marketplace.

Using Your Bluetooth Phone as a Remote Control
The Salling Clicker transforms your Sony Ericsson Bluetooth phone into a remote control to communicate with just about any application on your Mac OS X computer. Whether it be running a PowerPoint presentation or adjusting the volume on iTunes, this $10 piece of shareware gives Bluetooth fans a reason to smile.

Inside ScummVM: Classic Adventure Engine Overhaul
The short list of quintessential adventure games includes several picks from LucasArts' stable. While the genre might be fading, the ScummVM project is reviving classic games such as the Maniac Mansion and Monkey Island series. Howard Wen interviews the developers behind the ScummVM project.

Postfix: A Secure and Easy-to-Use MTA
While Sendmail runs half the mail servers in the world, there are smaller and easier-to-use mail transfer agents (MTAs). Network administrator Glenn Graham demonstrates how Postfix gives you most of the power with a fraction of the pain.

Building an Award-Winning Application by Milestones: An Interview with Martin Pittenauer
In this interview with Martin Pittenauer of TheCodingMonkeys, the software development group that also includes Martin Ott, Dominik Wagner, and Ulrich Bauer, he talks about how this group of guys sat down and decided that they wanted to create a great Mac OS X application. Once they had the initial concept, they set goals for themselves and methodically reached each milestone that eventually led to a 2003 Apple Design Award, and an unexpected prize in the Mac OS X Innovators Contest.

Memoization in Java Using Dynamic Proxy Classes
Memoization, or caching previously computed values of functions, can speed up certain classes of problems. Java 1.3's dynamic proxy classes make it possible to write generic memoization routines. Tom White explores this technique and explains when and how it can improve your performance.

Stored Procedures for Java Programmers
You can build your application on top of a persistence layer such as EJB, but that's not your only option. Another alternative is stored procedures. Nic Ferrier explains how they work and why the common objection -- portability -- doesn't always apply.

Embedded Markup Considered Harmful
How do you carry HTML or XML around inside an XML document? Not by using CDATA sections or escaping special characters, says Norm Walsh. Find out why embedding markup this way is wrong, and what alternatives there are.

New Books from O'Reilly & Associates

CVS Pocket Reference, 2nd Edition

Amazon Hacks

TiVo Hacks

O'Reilly Network Top Five Articles Last Week

  1. Postfix: A Secure and Easy-to-Use MTA
    While Sendmail runs half the mail servers in the world, there are smaller and easier-to-use mail transfer agents (MTAs). Network administrator Glenn Graham demonstrates how Postfix gives you most of the power with a fraction of the pain.

  2. Why Caldera Released Unix: A Brief History
    In January, Caldera, the latest owners of the "official" Unix source code, released some of the older versions of Unix under an open source license. Ian Darwin gives the history behind this.

  3. Guido van Rossum Speaks
    Guido van Rossum, creator of Python, recently announced a move from PythonLabs to Elemental Security. Steve Holden caught up with Guido to talk about the move, the future of Python, and computer programming for everybody.

  4. Five Habits for Successful Regular Expressions
    For many programmers, writing regular expressions is a black art. They stick to the features they know and hope for the best. Tony Stubblebine, author of Regular Expression Pocket Reference, says programmers can avoid a lot of trial and error by adopting these five habits for regular expression development. The code examples in this article use Perl, PHP, and Python, but the advice Tony espouses is applicable to nearly any regex implementation.

  5. Top Ten Digital Photography Tips
    You have a digital camera and have recorded the typical shots of family and friends. Now what? Here are ten tips to make your next batch of digital images so impressive that people will ask: "Hey, what type of camera do you have?" Guess what? It's not the camera.


Return to list of Network Newsletters.

Return to the O'Reilly Network.