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
Sell Us Your Item
For a $12.44 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
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.
Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 

Mastering Regular Expressions [Paperback]

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

List Price: $44.99
Price: $26.46 & FREE Shipping. Details
You Save: $18.53 (41%)
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 tomorrow, June 20? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student

Formats

Amazon Price New from Used from
Kindle Edition $19.79  
Paperback $26.46  
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

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


Frequently Bought Together

Mastering Regular Expressions + Regular Expressions Cookbook + Introducing Regular Expressions
Price for all three: $72.12

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: 7 x 1.1 x 9.2 inches
  • Shipping Weight: 1.7 pounds (View shipping rates and policies)
  • Average Customer Review: 4.5 out of 5 stars  See all reviews (158 customer reviews)
  • Amazon Best Sellers Rank: #20,905 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
135 of 145 people found the following review helpful
5.0 out of 5 stars I need more stars... Bravo Jeffrey December 8, 2001
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....

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. Read more ›

Comment | 
Was this review helpful to you?
48 of 49 people found the following review helpful
5.0 out of 5 stars 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?
22 of 23 people found the following review helpful
5.0 out of 5 stars i wish all tech books were this good March 7, 2002
By W. Gage
Format:Paperback
I can't say enough good things about this book.

Regular expressions are such a powerful concept, but some of that power would be easy to miss if not guided correctly through the topic. Jeffrey Freidl does a great job of making a potentially very dry subject interesting, even while getting very involved in all the complexities that are inherent in such a powerful abstraction. He also does a good job of presenting both the general topic of regular expressions and the specific characteristics of the various tools available to process them.

This is a book that you will come back to many times. I actually read it as a precursor to learning Perl several years ago. Then just recently I revisited it while taking a class on compiler construction and found that it still had useful insights for me. If you're a committed programmer, this book should be on your shelf.

Also, the criticisms I've read in reviews here are pretty misguided. It is "chatty", because the author has a genuine enthusiasm for his subject. It is also not a "teach yourself regular expressions in 24 hours" kind of book. There are actually lots of cookbook style examples, but the main point of the book is to give you a solid enough understanding of the general topic that you don't need examples to craft your regexes. In this case, little patience as a reader will be much rewarded.

Comment | 
Was this review helpful to you?
32 of 36 people found the following review helpful
5.0 out of 5 stars Learning Perl? Buy this first! February 7, 1998
By A Customer
Format:Paperback
I made the mistake of buying a bunch of books on Perl to try to learn Perl programming. I made progress, but it was slow -- and it beat me down. Then I bought THIS book. Perl's implementation of Regular Expressions is a great deal of the functionality of that language. This is true to the extent that trying to read Perl script without knowing Regular Expressions is tedious at best. This is not just another computer book. Jeffrey Friedl has put his heart and soul into this work, and it shows. He even offers free updates (in the truest, most honest sense of the word) from his own web page. This is the best programming book I own.

After reading this book, Perl script reads like USA Today! Save yourself lots of heartache. Buy this book, Mastering Regular Expressions -- read it -- THEN learn Perl!
Jeff Morris

Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars Nice tutorial and reference.
Very progressive approach of regexes, based on the explanation of examples, from quite simple ones to very complex ones. Read more
Published 25 days ago by Delfosse Roy Jean
5.0 out of 5 stars Detailed
Haven't used it much as of yet, but plan too in the future. It is detailed, well, written, and easy to understand.
Published 1 month ago by Timothy
5.0 out of 5 stars Precise and clear
Just what a book on regular expressions should be. Jeffrey Friedl keeps it as close to mathematical precision as the English language affords. Read more
Published 1 month ago by Guru
4.0 out of 5 stars Valuable book to add to my collection.
The author has a very good understanding of regular expressions. He presents most of the common stuff in the first few chapters and elaborates on the more tricky parts later. Read more
Published 2 months ago by Jack Matthews
1.0 out of 5 stars Not a good book
Teacher literally just told me this book was not good so yeah just so you know.

NOT GOOD!

But I am completely going off what my teacher just said so yeah.
Published 2 months ago by Doug Fresh
5.0 out of 5 stars Great book!
I highly recommend this book. It's an easy read and really breaks down regular expressions. This was money well spent.
Published 3 months ago by low
5.0 out of 5 stars this book changed my life
not even kidding. you know how people say "you have a problem, and you reach for a regular expression, now you have 2 problems? Read more
Published 4 months ago by Giles D. Bowkett
5.0 out of 5 stars More than I required
It covers several languages. Very well done. I was looking for unix/linux regular expressions that go with sed awk etc.
Bought that book also.
Published 6 months ago by abc
3.0 out of 5 stars Well written but an AWKward approach to Regex
The first chapter was clear and methodical. I really liked the author's style and thought process and was excited to read the rest of the book. Read more
Published 6 months ago by Dave
4.0 out of 5 stars To be master of regular expression
This is a bible of regular expression. It covers all kind of programming language about the regular expression. Excellent reference, but it could be difficult to start.. Read more
Published 7 months ago by Jaeha Lee
Search Customer Reviews
Only search this product's reviews


Forums

There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
Topic:
First post:
Prompts for sign-in
 



So You'd Like to...


Create a guide


Look for Similar Items by Category