Regex Essentials

Regular Expressions (”regex” for short) are extremely useful regardless of which programming language you are using. They work in Unix Ruby, PHP, JavaScript, and Perl. I even use them just for simple text processing with editors like BBEdit and TextMate. (Have a list of names which are formatted “Last name, first name” and want to invert it? Regex is the answer.) They can help validate user form input. They can help you clean up and alter data. They can help you search your code when developing. They can help you mine your weblogs for trends and stats. But a reliable regular expression can be tricky to write—especially for beginners who have a hard time understanding what the elements in the syntax signify.

Mike Malone has written a couple of nice blog posts that summarize some essentials for both beginners and for more experienced regex users.

One Response to “Regex Essentials”

  1. Kelly Wardrop Says:

    Thanks for the information. I have found your site very useful.

Leave a Reply