Buy new:
$53.99$53.99
Arrives:
Monday, July 24
Ships from: Amazon.com Sold by: Amazon.com
Buy used: $17.18
Other Sellers on Amazon
+ $4.99 shipping
86% positive over last 12 months
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required. Learn more
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Mastering Regular Expressions Third Edition
| Price | New from | Used from |
- Kindle
$13.20 - $36.99 Read with Our Free App - Paperback
$17.18 - $53.9941 Used from $8.62 29 New from $39.22
Purchase options and add-ons
If you don't use regular expressions yet, you will discover in this book a whole new world of mastery over your data. If you already use them, you'll appreciate this book's unprecedented detail and breadth of coverage. If you think you know all you need to know about regular expressions, this book is a stunning eye-opener.
As this book shows, a command of regular expressions is an invaluable skill. Regular expressions allow you to code complex and subtle text processing that you never imagined could be automated. Regular expressions can save you time and aggravation. They can be used to craft elegant solutions to a wide range of problems. Once you've mastered regular expressions, they'll become an invaluable part of your toolkit. You will wonder how you ever got by without them.
Yet despite their wide availability, flexibility, and unparalleled power, regular expressions are frequently underutilized. Yet what is power in the hands of an expert can be fraught with peril for the unwary. Mastering Regular Expressions will help you navigate the minefield to becoming an expert and help you optimize your use of regular expressions.
Mastering Regular Expressions, Third Edition, now includes a full chapter devoted to PHP and its powerful and expressive suite of regular expression functions, in addition to enhanced PHP coverage in the central "core" chapters. Furthermore, this edition has been updated throughout to reflect advances in other languages, including expanded in-depth coverage of Sun's java.util.regex package, which has emerged as the standard Java regex implementation.Topics include:
- A comparison of features among different versions of many languages and tools
- How the regular expression engine works
- Optimization (major savings available here!)
- Matching just what you want, but not what you don't want
- Sections and chapters on individual languages
Written in the lucid, entertaining tone that makes a complex, dry topic become crystal-clear to programmers, and sprinkled with solutions to complex real-world problems, Mastering Regular Expressions, Third Edition offers a wealth information that you can put to immediate use.
Reviews of this new edition and the second edition:
"There isn't a better (or more useful) book available on regular expressions."
--Zak Greant, Managing Director, eZ Systems
"A real tour-de-force of a book which not only covers the mechanics of regexes in extraordinary detail but also talks about efficiency and the use of regexes in Perl, Java, and .NET...If you use regular expressions as part of your professional work (even if you already have a good book on whatever language you're programming in) I would strongly recommend this book to you."
--Dr. Chris Brown, Linux Format
"The author does an outstanding job leading the reader from regex novice to master. The book is extremely easy to read and chock full of useful and relevant examples...Regular expressions are valuable tools that every developer should have in their toolbox. Mastering Regular Expressions is the definitive guide to the subject, and an outstanding resource that belongs on every programmer's bookshelf. Ten out of Ten Horseshoes."
--Jason Menard, Java Ranch
- ISBN-100596528124
- ISBN-13978-0596528126
- EditionThird
- PublisherO'Reilly Media
- Publication dateSeptember 12, 2006
- LanguageEnglish
- Dimensions7 x 1.3 x 9.19 inches
- Print length542 pages
Frequently bought together

What do customers buy after viewing this item?
- Highest ratedin this set of productsThis item:
Mastering Regular ExpressionsJeffrey FriedlPaperback$17.97 shipping - Lowest Pricein this set of products
Introducing Regular Expressions: Unraveling Regular Expressions, Step-by-StepMichael FitzgeraldPaperback - Most purchasedin this set of products
Python Pocket Reference: Python In Your Pocket (Pocket Reference (O'Reilly))Paperback
Programming Perl: Unmatched power for text processing and scriptingTom ChristiansenPaperback$22.50 shipping
From the brand
-
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
Editorial Reviews
About the Author
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.
Product details
- Publisher : O'Reilly Media; Third edition (September 12, 2006)
- Language : English
- Paperback : 542 pages
- ISBN-10 : 0596528124
- ISBN-13 : 978-0596528126
- Item Weight : 1.89 pounds
- Dimensions : 7 x 1.3 x 9.19 inches
- Best Sellers Rank: #188,115 in Books (See Top 100 in Books)
- #16 in Microsoft .NET
- #35 in JavaScript Programming (Books)
- #201 in Software Development (Books)
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
This book is the definitive guide on regex. Full stop. I’m not quite halfway through and it has already increased my understanding of regex in ways I hadn’t imagined possible. That said, the 3rd edition is 16 years old and it shows. The author regularly references now out-of-date technologies (e.g., PHP and Tcl). But that in no way hampers his ability to teach and ingrain the material. One just simply needs to understand that due to its age, some claims may no longer be true.
For example, (and bare in mind I’m halfway through so I don’t know what I don’t yet know) there’s a chart stating that MySQL’s regex engine is a DFA. From what I’ve read, and knowing that MySQL “upgraded” their regex support in version 8, I believe it may now be an NFA. Or, at the very least, a hybrid. I could be wrong, but the point is, before reading this book, I wouldn’t have understood enough to even make that guess.
Now, will I skip the chapters that focus on PHP and Tcl? Perhaps the latter. It’s not like I can’t come back and read it later if I find myself ankle-deep in Tcl regex one day. I could say the same for PHP, but it’s in a lot of legacy software, so a quick read through it is probably worthwhile.
Not to keep bringing it up, but even halfway through, my understanding of lookarounds increased substantially. I use all of them regularly, but with a half-understanding of what was going on or why it would work sometimes and others not. Beyond that, greedy/lazy/possessive quantifiers… grouping. Sure, I’ve used them at some point. Some more often than others and with more understanding. But now? I get it all.
It’s kind of a shame. I don’t have to write regex every day and when I do, it’s usually file searching, so it’s throw-away code. However, I haven’t yet read the chapters on efficiency, so perhaps my knowledge will grow in that area and that will pay off daily!
Anyway, if you have any regular use of regex, this book is worth it. I picked up a used copy. I’d have paid cover price ($44.99 USD) easily knowing what’s actually in the book, how it’s written, etc. That brings me to my final point. The author does an amazing job of keeping what could be a very dry subject fresh and clear. You just can’t appreciate that enough.
This book gave me the level of understanding I was looking for. After reading this book I can confidently say that I'm 1000% more comfortable reading and creating my own regex. I stopped once I reached chapter 7 because the last chapters, 7-10 are language specific chapters, but in the future I'll definitely refer back to those chapters once I'm working with those languages.
Lastly, I did get some flak from other devs while I was reading this book "Geez you're reading a book on regex?? wow that's too boring for me." etc. etc. Don't listen to the haters! If you want a greater understanding of regex, and this book can get you there then don't listen to those nerds. At the end of the day and with learning anything, it only matters that the nerd in your shoes understands the subject. Also, take your time reading the book. It's perfectly fine to pace yourself and take more time reading, because there's a lot of needed detail.
The only minor issues I had was in the tools used to demonstrate the concepts. Although no tool used cost the reader money if they wish to hands-on follow along, some of the downloads are from third-party sites which have no guarantee of offering the download by the time you get the book. Additionally, the author makes heavy use of Perl to demonstrate RegEx in scripting, which is fine for Perl users, but those that use other languages to fend for themselves. Seeing additional examples in other free languages, such as VBScript or JScript would have been nice.
Overall, Mastering Regular Expressions is an excellent choice for both learning the basics as well as better preparing yourself to apply them in real-world situations. The writing style is easy to understand and follow, and the layout allows this book to be a learning resource now, and a decent general reference later.
Top reviews from other countries
Friedl exposes the internals of the most common Regex engine implementations.
Whether you apply Regexes now and then, are a sysadmin, or are ramping up on work that demands Regex smarts, you will benefit greatly from this book.
(STARS){5}+
英語の勉強にもなっていいかもしれません。
とは言うものの、まだ最初の方しか読めていませんが。










