Mastering Regular Expressions and over one million other books are available for Amazon Kindle. Learn more


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Kindle Edition
 
   
Sell Back Your Copy
For a $11.33 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Mastering Regular Expressions
 
 
Start reading Mastering Regular Expressions on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Mastering Regular Expressions [Paperback]

Jeffrey E.F. Friedl (Author)
4.5 out of 5 stars  See all reviews (148 customer reviews)

List Price: $44.99
Price: $26.99 & this item ships for FREE with Super Saver Shipping. Details
You Save: $18.00 (40%)
  Special Offers Available
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Want it delivered Tuesday, May 22? Choose One-Day Shipping at checkout. Details
Textbook Student FREE Two-Day Shipping for students on millions of items. Learn more

Formats

Amazon Price New from Used from
Kindle Edition $19.79  
Paperback $26.99  
Sell Back Your Copy for $11.33
Whether you bought it on Amazon or somewhere else, you can sell it back through our Book Trade-In Program at the current price of $11.33.
Used Price$19.98
Trade-in Price$11.33
Price after
Trade-in
$8.65

Book Description

August 15, 2006 0596528124 978-0596528126 Third Edition

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 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


Special Offers and Product Promotions

  • Buy $50 in qualifying physical textbooks, get $2 in Amazon MP3 Credit. Here's how (restrictions apply)

Frequently Bought Together

Mastering Regular Expressions + Regular Expressions Cookbook + Regular Expression Pocket Reference: Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET (Pocket Reference (O'Reilly))
Price For All Three: $62.42

Show availability and shipping details

Buy the selected items together


Editorial Reviews

Amazon.com Review

Regular expressions are a central element of UNIX utilities like egrep and programming languages such as Perl. But whether you're a UNIX user or not, you can benefit from a better understanding of regular expressions since they work with applications ranging from validating data-entry fields to manipulating information in multimegabyte text files. Mastering Regular Expressions quickly covers the basics of regular-expression syntax, then delves into the mechanics of expression-processing, common pitfalls, performance issues, and implementation-specific differences. Written in an engaging style and sprinkled with solutions to complex real-world problems, Mastering Regular Expressions offers a wealth information that you can put to immediate use. --This text refers to an out of print or unavailable edition of this title.

Review

"Indispensable for text processing wizards and regex newcomers alike." - Paul Hudson, Linux Format, February 2007 "In addition to the sheer volume of information, one thing that sets this book apart is that the author uses "real-world" rather than contrived examples. A few of the examples were situations that I have yet to come across, but many were either "been there, done that" or things that I had to go out and try." - James Mohr, Linux Magazine, April 2007

Product Details

  • Paperback: 544 pages
  • Publisher: O'Reilly Media; Third Edition edition (August 15, 2006)
  • Language: English
  • ISBN-10: 0596528124
  • ISBN-13: 978-0596528126
  • Product Dimensions: 9.3 x 6.9 x 1 inches
  • Shipping Weight: 1.7 pounds (View shipping rates and policies)
  • Average Customer Review: 4.5 out of 5 stars  See all reviews (148 customer reviews)
  • Amazon Best Sellers Rank: #15,642 in Books (See Top 100 in Books)

More About the Author

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

Customer Reviews

Most Helpful Customer Reviews
125 of 134 people found the following review helpful
Format:Paperback
Jeffrey Friedl's "Matering Regular Expressions" does a facinating job in taking you through the jungle (and I mean jungle) of RegExp.

I am a Perl/CGI programmer, and I had considered myself good at RegExp even before I read this book. Most of the things I knew were from Programming Perl, 3rd edition (chapter 5, Pattern Matching). But I still decided to give Jeffrey a chance since I was having some trouble with my Parse::Syntax module, which is designed to parsing *any* programming language and highlighting the syntax accordingly (provided it has a syntax/grammer file written for the specific language). The accuracy of the parser (and more importantly the speed) does depend on well crafted regular expressions.

As I started reading the book, I couldn't stop. I took it to my school's cafeteria with me and no one could make me leave untill I finished the whole book. I was excited. I was pleased! Here is the outline of tha chapters:

Chapter 1 and 2 introduce you to regular expressions and give some basic regex examples. Mail utility and date matching is two of them.

Chapter 3 mostly talks about conventions that all the regex tools follow and their differences.

Chapter 4 deals with Traditional NFA, POSIX NFA and DFA regex engines and their pros and cons. What you'll like the most is the details provided by the author on each and every single example. He also uses a lot of step-by-step illustrations to take you deeper into the regex engine itself and see/feel how it works. He shows the point of backtrackings and provides awesome benchmarks. He uses such examples of matching a quote, allowing escaped quotes inside the pattern, matching C-style comments, IP addresses and many more.

Chapter 5 deals with writing efficient regular expressions for NFA engines. It also re-vists some of the examples provided in the previous chapter and fine-tunes them.

Chapter 6 and 7 deals with Tool-Language specific features of Regex engines. Chapter 6 is dedicated to Awk, Tcl and GNU Emacs, whereas chapter 7 is entirely dedicated to Perl, good over 100 pages of Perlism.

It's true that there're features that Perl 5.6 offers when it comes to regex that didn't exist at the time this book went to press, (lookbehinds, for example). But this no way makes this book dated. Just take my word for it. Jeffrey put together a great masterpiece that will not die for many years, no matter how fast the technology tends to enhance
Haven't read anything more exciting than this for many years.

Comment | 
Was this review helpful to you?
40 of 41 people found the following review helpful
Those wise birds! May 3, 2001
Format:Paperback
I got Mastering Regular Expressions in 1998 and I peek back regularly and it am proud to say is one of most used and useful books I own.

Regular expressions are for everyone. They are simple to write and can be close to impossible to read and even unimaginably harder to understand. But reading comes after you can craft one.

And this art of crafting RE is explained in astonishing detail and analysis in this book. Reader is carefully guided through basics, differences and common and uncommon pitfalls. Some of the parts are definitely not for the faint hearted! And this is especially true for parts that cover Perl RE. While main topic is Perl RE engine, a deep-enough travel through different RE dialects is made to help RE-crafting in almost any tool that supports REs.

I've used the methods described in the book in tools as different as MS VC++, various editors, search engines and programming (Perl, PHP, C++, ...). The ability to use RE usually impressed people to the point they were sure I am using some incredible magic.

But I must say that the most useful feature delivered in this book was ability to PARSE, UNDERSTAND and FIX a (slow, broken, strange acting) RE. This can be slowly absorbed by reader's (open) mind while carefully reading the book. The difference between meant/written can be as extreme as it can get in RE. I can (proudly) say I've been able to fix several complex REs, by simply (one could say blindly) following the rules laid in the book.

My opinion is thath without this book real understanding of RE is almost impossible. I recommended it all of those who use programs that support (any form) of RE engine. It will help them solve some (hard) problems incredibly fast!

Comment | 
Was this review helpful to you?
18 of 18 people found the following review helpful
So good, I bought it twice! January 5, 2003
Format:Paperback|Amazon 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?
Most Recent Customer Reviews
fantastic book
Thorough book, and a joy to read as well; a technical book you will actually want to read cover to cover! Read more
Published 1 day ago by linux
Best Computer Book I have read
For the uninitiated, Regex is hard. The book by Freidl handles the topic very well. Starting off slow, and with practical examples, it is only a few pages before the basic... Read more
Published 2 months ago by javlinsharp
This is the book on regular expressions.
During the last couple years I have run across several reviews online naming Friedl's "Mastering Regular Expressions" as the best single guide to learning regular expressions. Read more
Published 3 months ago by JWM
As Promised
I received the item as it was described and in the condition explained. Satisfied. The only downfall was that I didn't realize that this was a first edition, and there were later... Read more
Published 3 months ago by eggleston
The best Regex book out there.
This book is the best regular expression book out there. I've been writing software for several years and my practical experience didn't scratch the surface of what regular... Read more
Published 4 months ago by jimmy dean
Always Excellent
O'Reilly can almost always be relied upon to produce reliable guides. This is no exception. Whatever Regex skills I thought I had before getting this book have been improved upon a... Read more
Published 6 months ago by S. Mouton
A classic, if not THE regex classic
This is one of the best books a person could imagine on a highly technical theme. The author keeps a wonderful balance of theory, practice, and those pesky details that really make... Read more
Published 7 months ago by JonShops
good book
the email regex is definitely not RFC822. making it conform to the newest email standard, RFC5322 makes a 9MB regex. Read more
Published 11 months ago by Jim E. Michaels
Regex fun and games
I bought this book to do some work on the firewall filters and the smtp proxy at work. I liked it a lot, it was pretty clear and to the point. Read more
Published 17 months ago by Kurt Ploeger
Definitive and Apropos...
Mr. Friedl was, apparently, the right man in the right place at the right time to write this book. If you thought learning regex would be too daunting, then you need to think... Read more
Published 18 months ago by Dilly Tumly
Search Customer Reviews
Only search this product's reviews

Inside This Book (learn more)
Key Phrases - Statistically Improbable Phrases (SIPs): (learn more)
modifying text, matching text, unicode version, preg functions, regex flavor, regex literal, capturing parentheses, replacement operand, overall regex, original target string, default regex, regex engine, lazy quantifiers, regex object, egrep support, possessive quantifiers, neverending match, matcher object, matcher methods, regex construct, anchoring bounds, discrimination optimization, regular expression features, common metacharacters, zeroth group
Key Phrases - Capitalized Phrases (CAPs): (learn more)
Sun's Java, Perl Enhancements, The Preg Functions, The Matcher Object, Efficient Expression, Unrolling the Loop, Ten Thousand, Few Short Examples, The Mechanics of Expression Processing, Character Encodings, Argument Summary, Common Optimizations, Jeffrey Friedl, Perl Efficiency Issues, Extended Examples, Regex-Related Perlisms, Extended Introductory Examples, Henry Spencer, Imports System, The King, Core Object Details, Expanding the Foundation, Practical Regex Techniques, Basic Properties, The Preg Function Interface
Browse Sample Pages:
Front Cover | Table of Contents | First Pages | Index | Back Cover | Surprise Me!
Search Inside This Book:


What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(30)
(17)
(16)

Your tags: Add your first tag
 

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums





Look for Similar Items by Category


Look for Similar Items by Subject