Book Review: SAMS Teach Yourself Regular Expressions in 10 Minutes

I bought this book, Sams Teach Yourself Regular Expressions in 10 Minutes, years ago, and read it back then after not being able to completely digest O’Reilly’s Mastering Regular Expressions (a much larger book). While the O’Reilly book has a lot more content, more examples, and covers several different languages’ regexp parsers, I found the SAMS book a lot easier to process. As the name implies, each chapter is designed to be covered in about 10 minutes, so if you have a couple of hours to kill, you can easily plow through the whole book and try out its examples to get a decent working knowledge of regexps.

If you don’t yet know what regular expressions are, they are a system for matching text for the purpose of searching and replacing. They are built in, or available as add-ons, to most programming languages, and allow for powerful text searches and manipulation. While they may take different forms (standalone utilities, such as sed and awk in *nix shells, search and replace features in an editor such as vim), integrated commands in Perl or Ruby, or libraries in JavaScript, Python, or .NET), the basics among the regexp processors in all are the same.

Despite the book’s age, the content is still very relevant, as regexp is not something that changes as frequently as full-blown programming languages.

If you want to get started with regular expressions, regardless of whether you are programming in bash, JavaScript, .NET, Perl, Python, PHP, Ruby, etc., I highly recommend this book. Once you’ve moved beyond the content of this book, the O’Reilly book gives regular expressions a very complete treatment, or you could dive into your chosen language’s specific documentation to get more proficient.

Leave a Reply