Sunday, August 19, 2012

[Book Review] Introducing Regular Expressions


This is a book review for Introducing Regular Expressions by Michael Fitzgerald, OReilly Media, ISBN 1449392687. 

Solid Foundations, Reviews and fill in gaps

The book warns that 'if you happen to already know something about regular expression.. this book may not be where you want to start…'. I have written a few scripts that uses regular expression to identify valid email addresses, IP addresses, etc. but always a one-liner that I typically figure out (or find examples of online) and forget about, so I have decided to give this book a shot. It turns out to be a good decision for me as the book introduced various new tools, gave concepts a good review, and fill in a few knowledge gaps for me. 

The book takes you from the introductory topics such as 'What is Regular Expressions?" to finally writing full sed and Perl scripts that takes a full text file and convert it into a full HTML file in Chapter 9. Along the way the author introduces various new tools, online and desktop-local. Here are the pros of the book: 

1. Batteries included, all examples are downloadable from Git and OReilly site. 
2. Small examples that illustrates a single point and no more, great for learning. 
3. Introduces new tools (see item 1 below). 
4. Covers a wide array of topics in just ~150 pages.
5. Real world related that you can take it to your job right away.  

If I were to look for improvements to the book, aka wish list, some of them would be: 

1. Personally I would've prefer to pick just one open source tool and go deeper into the same tool as the readers progress. Perhaps the author can mention new tools but stick to the same tool for the majority of the examples? 
2. Some suggestions in see or Perl on finding Unicode conversions. I find myself wondering about searching for traditional Chinese characters within text when I read about the topic. Took me a bit to tinker around in Python to find out how to do it. I will probably post it on my blog sometime in the future. 
3. Completely optional, but my choice of language is Python, so I personally always think about 'how to do that in Python's RE module' as I read this book. As I am typing this review, I am thinking that maybe I will take on Chapter 9's example to write in Python as a bit of a challenge to myself. If I do, I will post it on my blog and update this review. 

Overall, a fantastic book on covering the basics and fill in knowledge gaps for me. 



No comments:

Post a Comment