Buy New

or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
Buy Used
Used - Good See details
$22.39 & eligible for FREE Super Saver Shipping on orders over $25. Details

or
Sign in to turn on 1-Click ordering.
 
   
Sell Back Your Copy
For a $5.34 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Mastering Regular Expressions
 
 
Tell the Publisher!
I'd like to read this book on Kindle

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 (144 customer reviews)

List Price: $44.99
Price: $27.08 & this item ships for FREE with Super Saver Shipping. Details
You Save: $17.91 (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 Thursday, February 2? 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
Paperback $27.08  
Like this book? Find similar titles from O'Reilly and Partners in our O'Reilly Bookstore.

Book Description

0596528124 978-0596528126 August 15, 2006 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 $5 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: $63.47

Show availability and shipping details

Buy the selected items together

Customers Who Bought This Item Also Bought


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 (144 customer reviews)
  • Amazon Best Sellers Rank: #16,448 in Books (See Top 100 in Books)

More About the Author

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

 

Customer Reviews

144 Reviews
5 star:
 (102)
4 star:
 (24)
3 star:
 (10)
2 star:
 (6)
1 star:
 (2)
 
 
 
 
 
Average Customer Review
4.5 out of 5 stars (144 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

123 of 132 people found the following review helpful:
5.0 out of 5 stars I need more stars... Bravo Jeffrey, December 8, 2001
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.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


38 of 39 people found the following review helpful:
5.0 out of 5 stars Those wise birds!, May 3, 2001
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!

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


17 of 17 people found the following review helpful:
5.0 out of 5 stars So good, I bought it twice!, January 5, 2003
By 
Bob Nelson (Frisco, TX United States) - See all my reviews
(REAL NAME)   
Amazon Verified Purchase(What's this?)
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).

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent 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.
 
(29)
(16)
(15)

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

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