Mastering Regular Expressions, 2nd Edition O'Reilly, 2002
Be warned, though, this is not a book for faint hearts. On my first read-through, I decided to stop after the second chapter, as I didn't want to be overwhelmed. I felt armed with sufficient information to get me both interested and to start experimenting on my own. After several months, I returned and read just over half the book. I learned a lot more, but it left my head spinning. That's no criticism of Jeffrey Friedl's approach - he admits it's heady stuff and takes a long time to sink in. A sound knowledge of regular expressions is essential if you want to move beyond the basic level of JavaScript, PHP or any other scripting language. They are patterns that search through text and data files matching and manipulating whatever it is you're looking for - just like the wildcard characters . and *, but far more precise and powerful. Unfortunately, each programming language implements a different set of utilities, although the most widely used ones come from Perl. Friedl's book covers them all, which can be frustrating if you're interested in learning to use regexes in only one environment, such as JavaScript. It's worth persisting, though, and following Friedl's advice that the most important step towards mastering regular expressions is understanding how the main search engines work. Once you know that, you can come back and study the details, and begin to use more sophisticated techniques such as lookahead and lookbehind. Like learning a foreign language, fluency only comes with constant practice, and this is the essential grammar book you need to keep coming back to. The book is full of practical examples, and Friedl pops in the occasional quiz that really helps consolidate understanding. Not an easy book, nor an easy subject, but both definitely worthwhile. |
PHP Developer's Cookbook Sams, 2001
|
© 2002-5, Japan Interface. All rights reserved.