Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Mastering Regular Expressions by Jeffrey Friedl
ISBN 1-56592-257-3
Copyright 1997 O'Reilly & Associates, Inc.

Capsule Review

Excellent book. 5 stars out of 5.

Who should be interested in this book?

  • Anyone who works on a machine with Unix variant OS
  • Anyone who finds perlre too dry or daunting
  • Anyone who has always wondered what a regular expression engine was like under the hood but never bothered to try to read the code

Full Review

Mastering Regular Expressions by Jeffrey Friedl is, without a doubt, THE book about regular expressions. To my knowledge, there is no other book devoted specifically to the subject, nor need there be now that Jeff's taken care of the matter.

The next time you're in the book store wondering whether to buy it, pick it up and turn to Tables 6-1 and 6-2, titled, "A Superficial Survey of a Few Common Programs' Flavor" and "A Comical Look at a Few Greps", respectively. If, after perusing these nuggets, you still don't think you need the book, then just walk away. I can think of no more persuasive argument. That page is bookmarked with a Post-It in my book, but it's completely unnecessary because the book naturally falls open to that spot. I use it that much.

The book opens with a couple of chapters that introduce the reader to regular expressions. Good examples and clear prose bring the subject down to a level where any competent programmer can understand it. But be sure to read the typographical conventions in the Preface. Otherwise, you may wonder what language the examples are written in.

The two most useful sections of the book for most Perl programmers will be Chapter 5, "Crafting a Regular Expression" and, of course, Chapter 7, "Perl Regular Expressions". As you read Chapter 5, you'll probably be surprised by how much you DON'T know about creating a functional and efficient regular expression. And Chapter 7 is, without a doubt, the most comprehensive discussion of Perl's particular regular expression features that you'll find anywhere.

Chapter 4, "The Mechanics of Expression Parsing", will separate the casual, 40-hour a week programmers from the REAL programmers. In this chapter, you'll learn exactly how regular expression engines work. By the end, you'll know your DFAs from your NFAs, and you'll be able to talk bump-along and backtracking with the best of them. And when someone mentions POSIX regular expressions, the words "Longest leftmost" will be out of your mouth before you know what happened.

The rest of the book is mostly tool-specific information. TCL, AWK, and GNU Emacs are covered in depth, in addition to Perl.

So, is there anything wrong with this book? Well, yes, I suppose there is. First, if anything, it covers its subject TOO thoroughly. I mean, let's face it, most people aren't going to be terribly interested in Chapter 4. I liked it, but I'm kinda weird that way. The majority of people could make do with chapters 1 and 2, and maybe 7 if they do Perl regularly.

The second problem is that chapter 7 is a little dated at this point. I would hate to be an author trying to keep up with Ilya Zakharevich's enhancements to the Perl regular expression engine. Fortunately, most of Ilya's major enhancements are very advanced features which most people will never understand well enough to use, so chapter 7 will continue to serve most people just fine. Still, I'd love to see Jeff come out with Revision 2 at some point.

But until and unless that happens, my well-worn copy of MRE will remain close at hand for the foreseeable future. Why? Because Perl's regex features may continue to grow and expand, but Table 6-1 will be relevant as long as Unix variants exist in the world.

*Woof*


In reply to Mastering Regular Expressions by splinky

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found