Mastering Regular Expressions, 3rd Edition
Understand Your Data and Be More Productive
Publisher: O'Reilly Media
Final Release Date: August 2006
Pages: 544

Regular expressions are an extremely powerful tool for manipulating text and data. They are now standard features in a wide range of languages and popular tools, including Perl, Python, Ruby, Java, VB.NET and C# (and any language using the .NET Framework), PHP, and MySQL.

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 regularexpressions, 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 immediateuse.

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 regexnovice to master. The book is extremely easy to read and chock full ofuseful and relevant examples...Regular expressions are valuable toolsthat every developer should have in their toolbox. Mastering RegularExpressions is the definitive guide to the subject, and an outstandingresource that belongs on every programmer's bookshelf. Ten out of TenHorseshoes."

--Jason Menard, Java Ranch

Product Details
About the Author
Recommended for You
Customer Reviews


by PowerReviews
oreillyMastering Regular Expressions, 3rd Edition

(based on 8 reviews)

Ratings Distribution

  • 5 Stars



  • 4 Stars



  • 3 Stars



  • 2 Stars



  • 1 Stars




of respondents would recommend this to a friend.

Reviewed by 8 customers

Sort by

Displaying reviews 1-8

Back to top


Very Helpful

By Tom

from Landenberg, PA

Verified Buyer

Comments about oreilly Mastering Regular Expressions, 3rd Edition:

I have used regular expressions in perl programing previously but this book gave me a more systematic approach.

(4 of 4 customers found this review helpful)


Best Regex resource available

By Kevin

from Phx, Az

Verified Reviewer


  • Concise
  • Helpful examples
  • Well-written


    Best Uses

    • Expert
    • Intermediate
    • Novice
    • Student

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    I use regex daily, so I felt like I had a pretty good handle on the subject. After reading this book, I realized there is a wonderful and mind bogglingly complex world of theory behind regular expressions I was totally unaware of.

    After chapter three, you should have a good handle on using some regex in your day to day life. Chapters four through six will explode your brain, in a good way.

    The last chapters don't do a lot for me, but that doesn't mean they are not useful.

    The first six chapters are worth the price of admission. If you want to understand/use/apply regex, this book is second to none.

    (9 of 10 customers found this review helpful)


    The best... Bar none!

    By DarrellBlackhawk

    from San Francisco, CA

    About Me Developer

    Verified Reviewer


    • Accurate
    • Excellent
    • Helpful examples
    • Well-written


    • It hurts my head at times

    Best Uses

    • Expert
    • Intermediate
    • Novice
    • Student

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    As many folks in the computer field have done, I've collected quite a number of technical books over the years. On my desk (which is 'L shaped') to the right, is a 2 shelf bookcase which is fully stocked from the top, to the two inner shelves, with 70 books (I just counted them). Jeffrey Friedl's "Mastering Regular Expressions" holds a prominent position on the bottom shelf at "right arm's length" - I probably reach for it 40% of the time. I guess that sums up my opinion of this great resource!

    (2 of 2 customers found this review helpful)


    Wonderful, Great, Epic!

    By ifeatu

    from Undisclosed

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    This is a GREAT book for Linux Admins, beginning programmers with no formal training...and people into managing and manipulating data. It is well written and if you've used unix from the command line in any capasity (sed, ed, vi, emacs, bsh, csh, ksh...) then you'll have no problem following this book.

    (8 of 16 customers found this review helpful)


    Mastering Regular Expressions, Third Edition

    By Frederick J Eccher Jr

    from Undisclosed

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    Mastering Regular Expressions, Third Edition

    By Jeffrey E. F. Friedl

    Third Edition August 2006

    Pages: 542

    Series: Adobe Developer Library

    ISBN: 0-596-52812-4


    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 of information that you can put to immediate use.

    The description above is quite an understatement. Even the full description does not do this book justice. Mastering Regular Expressions, Third Edition is almost a classic and should be on your bookshelf, chained down. If your programming friends, coworkers, or enemies try to borrow this book, beware. It takes quite a while to get it back, even bent, spindled and mutilated so you might not want it back [yeah that was actually tried]. You might try a rule about using it at your desk, but that did not work for me either.

    My experience agreed with almost everything written, except that I do not have the in depth use of RegEx the author clearly has. I wish I was on the same page with him in experience with RegEx. I started with RegEx in college in the early 90s and remember six projects that I had to do that could have been much easier with this book. My programming experience used RegEx on occasion but not with the power explained in this book. I appreciate the detailed and thorough comparisons of the languages. The only word I really missed in the INDEX and Table of Contents was: SECURITY. Using RegEx to make sure security issues are properly handled would really help many programmers and developers.

    The topics start with a Preface, then moves to Introduction to Regular Expressions, then Extended Introductory Example, then Overview of Regular Expression Features and Flavors, then The Mechanics of Expression Processing, then the Practical Regex Techniques, then Crafting an Efficient Expression, then Perl, Java, .NET, PHP, and finally the Index. Remember to read the Preface, it is very interesting. The author makes some points about how to read the book [the first six chapters] and how to THINK.

    The 10 chapters are written very thoroughly. I like that about this book. Explanations of history and trivia are all over the place but are written like a story and easy to read. The figures are good and useful in the explanation of the concepts. The code is usually more than a few lines. This is a more complicated book and requires more expressive code examples.

    The topics are useful and helpful in just about any language, including the more recent powerful languages like .NET and Java.

    I thought the discriminations made about the different languages that use Regular Expressions went from general to specific in a hurry. Even so, the book is pretty long and needs to be digested in discrete chunks. No way to read this in one evening. There is no way to digest the concepts and comparisons very fast, at least for me. This is valuable knowledge worth your time to read and digest as thoroughly as possible.

    The 540+ pages were easy to read and understand, partly told as a story. I read it in one week. There were a few typos and grammar errors, but not very many. The book is for someone who is a beginner or an expert and needs to know the specific times when one regular expression has even a slight benefit over another. More experienced people should look it over to make sure they are up to speed with this author.

    I would give this book 5 out of 5 stars. Definitive!!!!!

    Frederick J Eccher Jr


    M.S. Management of Information Systems

    A.B. Psychology

    B.A. Biology

    President, Board of Directors, Saint Louis Visual Basic Users Group

    November 26, 2006

    (3 of 4 customers found this review helpful)


    Good and enjoyed reading it

    By Vikramaditya J

    from Undisclosed

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    Regular Expressions is basically the same across most languages (some variations as how you use it and terminology differences too), whether it may be C#, Javascript, PHP, Ruby, Python, TCL, Perl, or JAVA. This is amazing and should be used as an hand book for students and beginning to intermediate developers. As the book is in third edition some basics of the programming languages are expected to be know by its readers. Overall its a good book and worth a reading.

    (5 of 5 customers found this review helpful)


    Not a Reference! Everything you ever wanted to know about regex!

    By ismism

    from Undisclosed

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    As the author states, this is not a reference. It is everything you might ever want to know about regular expressions and then some. Well written, but a bit too epic for me, and if you aren't interested in perl - as I am not - there is a lot of information you just don't need (or want).

    (11 of 11 customers found this review helpful)


    the title says it all

    By Jeanne Boyarsky

    from Undisclosed

    Comments about oreilly Mastering Regular Expressions, 3rd Edition:

    "Mastering Regular Expressions" takes a great book and modernizes it to include the latest programming languages. The book starts out with assuming you know anything about Regular Expressions _ aside from the concept to be interested in picking up the book.

    The author introduces regular expressions through examples and quickly introduces the constructs. The second third of the book goes into the details of how regular expressions are processed. This includes correctness and efficiency issues. The final third on the book goes over the syntax in Java, .NET, Perl and PHP. Tools like grep and awk are described in the text as well.

    An alternate title for this book would have been "Thinking in Regular Expressions." Even if you think you know regular expressions, this book teaches you how much more there is to learn. It also teaches you some of the finer points of regular expressions in your favorite programming language along with cross references to the earlier part of the book.

    The author uses good analogies to make the text understandable. After awhile, the concepts get so complicated that you have to read it many times to understand. A typically O'Reilly book. I've only had this book two weeks and I've already used it to make me a more effective developer!

    Displaying reviews 1-8

    Back to top

    Buy 2 Get 1 Free Free Shipping Guarantee
    Buying Options
    Immediate Access - Go Digital what's this?
    Ebook: $42.99
    Formats:  DAISY, ePub, Mobi, PDF
    Print & Ebook: $54.99
    Print: $49.99

    Available in Multiple Languages