RegExp - Top Resources

RegExp, Huh, What are they good for, Absolutely nothing, Say it again!

So what's a RegExp?

Regular Expressions (also RegExp, RegEx) are a powerful, but potentially confusing, tool for text-matching and manipulation. Many (most?) programming languages implement some version of regular expression — personally I've used them mainly in Javascript and Python, and until recently avoided them like the plague.

If you've ever come across regular expressions and wondered "what the hell are these things and how do they work", the following list may be of some use to you:

  • Introduction to Regular Expressions by David Mertz — a short (text) introduction
  • RegEx One — an interactive tutorial for beginners
  • Mastering Regular Expressions by Jeffrey Friedl — this is the gold standard reference book, starting from basics and building to a deep, deep dive (the link provided is to Amazon US, but there are Kindle/PDF versions out there as well)
  • Patterns (Mac application) — an extremely useful Mac utility for trying out regular expressions
  • Debuggex — a web-app for trying out regular expressions
  • BBEdit's Grep manual — don't be fooled by the 'Grep' bit, this is a very useful cheat-sheet for common substitutions