Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image
Have one to sell? Sell on Amazon

Mastering Regular Expressions, Second Edition Paperback – July 15, 2002

ISBN-13: 978-0596002893 ISBN-10: 0596002890 Edition: Second Edition
Amazon Price New from Used from
"Please retry"
$25.25 $7.09

There is a newer edition of this item:


Hero Quick Promo
Save up to 90% on Textbooks
Rent textbooks, buy textbooks, or get up to 80% back when you sell us your books. Shop Now

Editorial Reviews

About the Author

Jeffrey Friedl was raised in the countryside of Rootstown, Ohio, and had aspirations of being an astronomer until one day he noticed a TRS-80 Model I sitting unused in the corner of the chem lab (bristling with a full 16K of RAM, no less). He eventually began using Unix (and regular expressions) in 1980, and earned degrees in Computer Science from Kent (BS) and the University of New Hampshire (MS). He did kernel development for Omron Corporation in Kyoto, Japan for eight years before moving in 1997 to Silicon Valley to apply his regular-expression know-how to financial news and data for a little-known company called "Yahoo!"

When faced with the daunting task of filling his copious free time, Jeffrey enjoys playing Ultimate Frisbee and basketball with friends at Yahoo!, programming his house, and feeding the squirrels and jays in his back yard. He also enjoys spending time with his wife Fumie, and preparing for the Fall 2002 release of their first "software project" together.


Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

  • Series: Nutshell Handbooks
  • Paperback: 496 pages
  • Publisher: O'Reilly Media; Second Edition edition (July 15, 2002)
  • Language: English
  • ISBN-10: 0596002890
  • ISBN-13: 978-0596002893
  • Product Dimensions: 7 x 1.2 x 9.2 inches
  • Shipping Weight: 1.7 pounds
  • Average Customer Review: 4.7 out of 5 stars  See all reviews (41 customer reviews)
  • Amazon Best Sellers Rank: #335,731 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

4.7 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

37 of 42 people found the following review helpful By Fruitcake on September 26, 2002
Format: Paperback Verified Purchase
I bought this book on a whim, mainly because I try to buy (and read... ugh!) a hard-core technical book every month or so, but mainly because my UNIX scripting abilities have become rusty with disuse. I used to be able to write a tight, 10-line csh script to mangledit thousands of files at a single time. Now I hack away at files manually with vi. The other day, I even forgot how to search & replace. My kung fu isn't nearly what it used to be.
It usually takes me about a month to slog through a new book (especially academic texts, which are great but make you want to have a stiff martini before each new chapter) but I tore through Friedl's book in a few days. It's an outstanding reference for understanding & learning to use regular expressions.
Regexes can be cryptic to say the least, but Friedl offers many examples, broken down into step-by-step instructions and explanations of how each regex works (in many cases, right down to the individual character level). He covers a variety of platforms and languages - the hardcore Perl enthusiast will enjoy this book greatly, but he offers fairly equal time to alternative languages like Java and the "grep" family.
All that said, this book is an outstanding technical reference, pure and simple, for two reasons:
- Friedl uses an interesting new typesetting convention to illustrate which sections of text are regular expressions, and which sections are not. It's hard to describe (and impossible to reproduce here) but they look like 90-degree braces at the upper-left and lower-right corners. This is a FANTASTIC approach and I for one would love to see this extended to other technical books.
- Speaking of other things I would love to see extended to other technical books, THIS BOOK HAS ALMOST NO ERRORS!
Read more ›
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
18 of 19 people found the following review helpful By Bob Nelson on January 5, 2003
Format: Paperback Verified Purchase
In spite of the vow that Friedl would not put himself (and his family) through the rigors of writing a followup to his first edition, I sure am glad he made the decision to write a second edition. Over 5 years ago, I got the first such book and found it to be a humbling experience -- realizing just how little I *really* knew about regular expressions (in spite of thinking my skills were quite advanced in that area).
Now, years later and as an instructor of UNIX at North Lake College in Irving, Texas, I highly recommend this book to even our first year students. Friedl's clear explanation of this topic and the manner in which he presents the material makes it comprehensible to even those that have never had experience with regex's before. Like Perl's Larry Wall, Jeffrey Friedl has a strong background in natural languages. That contributes not only to bhis lucid writing style but also helps in terms of understanding regex's as a "little language".
This 2nd edition is particularly welcome because of its extensive coverage of regular expressions in the context of Java. That ons aspect alone is sufficient to get the updated second edition (to say nothing of the enhancements in Perl since the first edition of the book).
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
15 of 16 people found the following review helpful By Scott E. Packard on August 12, 2002
Format: Paperback
Regular expressions help you "lex", or make sense of text input to your program in a method much more powerful than your junior college or MCSE program taught you.
In the mid '80's I wrote a lexer/parser/compiler as a class assignment. I definitely used regular expressions in order to break the input down into lexemes so I could generate object code. Back then, we learned regular expressions "the hard way".
This book makes learning them easier. You don't have to be writing a compiler in order to make use of regexes! Spam filtering is my current use for them.
2nd ed. vs. 1st ed.: He attacks the subject more seriously.
He (as far as I can tell) dropped "vi" coverage.
He uses Perl 5.8 for his examples, though has chapters for the most popular regex engines, including VB.NET.
Summary: I think it's easier to follow and more business-oriented than the 1st edition, though don't toss the 1st edition. You'll need them both.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
8 of 8 people found the following review helpful By Amazon Customer VINE VOICE on May 28, 2003
Format: Paperback
Most computer programmers have heard of regular expressions, discussed in hushed tones and conjuring images of Unix gurus and their incomprehensible commands and godlike mastery of their systems, yet few actually know enough about regular expressions or how they work to do more than a simple word match using one, if that.
This book covers regular expressions from top to bottom in great and exhaustive detail, including the hows and whys of performance and supported features between the different engines that process them. Though geared mainly toward Perl, the examples and text will apply to nearly any system that provides support, from PHP to ASP to Python.
The text is fairly dense and is not exactly geared toward the novice programmer, though. I've had classes in Finite State Machines and still had to really apply my grey matter in a few spots to understand everything being discussed. However, the understanding the reader gains upon completion of the text is invaluable and will expand one's programming potential exponentially.
The one real lack of the book is a good overview and quick-reference card, but on the whole, the book is a good selection from the O'Reilly library and well worth the read of any serious programmer.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Recent Customer Reviews