Skip navigation

Mastering Regular Expressions, 3rd Edition

PRObooks

 

Mastering Regular Expressions, 3rd Edition

There comes a moment in any serious developer s career the need to learn how to decipher, appreciate, and ultimately leverage the power of regular expressions. Like any new, abbreviated syntax, learning regular expressions can be taxing and exhilarating at the same time. Looking at a complex assembly of symbols that can be applied toward a thorny character-parsing routine is frightening to those uninitiated to the elegance of how regular expressions can do so much with so little. Any determined developer knows the best way to reach a solution is to work through the problem, and those assertive enough to not only learn, but master, regular expressions will reap the rewards of their efforts to apply toward .NET (and many other languages).

 

Mastering Regular Expressions does for the reader exactly what the title advertises. Its 10 chapters span topics ranging from introductions and examples followed by a deeper analysis of what makes regular expressions tick. After diving deeply into the mechanics of expression processing, author Jeffrey E.F. Friedl leads readers through the art of crafting elegant and efficient regular expressions, showing the reader some truly astounding constructs. For those who followed the book to this point, what once were mysterious sequences of back slashes, question marks, asterisks, pound signs, brackets, and numbers, are now an intelligent collection of meaningful filters to be applied to numerous text processing routines.

 

The remaining two-thirds of the book dedicate individual chapters toward implementing regular expressions in Perl, Java, .NET, and PHP. Even though .NET developers may be tempted to gloss over the other languages, it s best to read the other language chapters as intently as the .NET chapter to not only further appreciate the flexibility and cross-language durability that using regular expressions provides, but also to see how regex implementations vary depending on the preferred language being used. While some .NET purists may ding the book for having slightly more than 30 pages dedicated to their choice language, those 30 pages pack more important information on the topic than most thick intermediate and advanced .NET-specific titles.

 

The .NET chapter in particular focuses on the System.Text.RegularExpressions library and using regex in three increasing orders of parsing optimization: parsing, on-the-fly compilation, and pre-compiled regexes. Friedl also dissects the various options the .NET architects included in the .NET regex implementation, and even questions the value of certain methods, such as RegexOptions.RightToLeft, which the author ultimately concludes to use at your own risk. The remainder of the chapter runs through code exercises and examines the most meaningful methods available in the RegexOptions, RegexObj, and GroupObj objects.

 

There s a reason why this book is being published in its third iteration. It is a title on which numerous developers cut their teeth on the topic, and who continue to hold it in high regard (along with other base technology books, especially those from O Reilly s Nutshell collection). Mastering Regular Expressions offers clear examples and no fluff; the content supplies the knowledge necessary to realize the mastery promise. Those students intent on reading and practicing the book s contents from cover to cover will be rewarded with a skill that will outlive languages, frameworks, and operating systems. Making a small investment now will pay huge dividends in future practices.

 

Mike Riley

 

Rating:

Title: Mastering Regular Expressions, 3rd Edition

Author: Jeffrey E.F. Friedl

Publisher: O Reilly Media

ISBN: 1-596-52812-4

Web Site: http://www.oreilly.com

Price: US$44.99

Page Count: 542

 

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish