Regular Expressions Cookbook
Detailed Solutions in Eight Programming Languages
Publisher: O'Reilly Media
Released: May 2009
Pages: 510

This cookbook provides more than 100 recipes to help you crunch data and manipulate text with regular expressions. Every programmer can find uses for regular expressions, but their power doesn't come worry-free. Even seasoned users often suffer from poor performance, false positives, false negatives, or perplexing bugs. Regular Expressions Cookbook offers step-by-step instructions for some of the most common tasks involving this tool, with recipes for C#, Java, JavaScript, Perl, PHP, Python, Ruby, and VB.NET.

With this book, you will:

  • Understand the basics of regular expressions through a concise tutorial
  • Use regular expressions effectively in several programming and scripting languages
  • Learn how to validate and format input
  • Manage words, lines, special characters, and numerical values
  • Find solutions for using regular expressions in URLs, paths, markup, and data exchange
  • Learn the nuances of more advanced regex features
  • Understand how regular expressions' APIs, syntax, and behavior differ from language to language
  • Write better regular expressions for custom needs

Whether you're a novice or an experienced user, Regular Expressions Cookbook will help deepen your knowledge of this unique and irreplaceable tool. You'll learn powerful new tricks, avoid language-specific gotchas, and save valuable time with this huge library of proven solutions to difficult, real-world problems.

Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
O'Reilly MediaRegular Expressions Cookbook
 
3.5

(based on 8 reviews)

Ratings Distribution

  • 5 Stars

     

    (2)

  • 4 Stars

     

    (3)

  • 3 Stars

     

    (1)

  • 2 Stars

     

    (1)

  • 1 Stars

     

    (1)

83%

of respondents would recommend this to a friend.

Pros

  • Helpful examples (3)

Cons

    Best Uses

    • Expert (3)
    • Intermediate (3)
      • Reviewer Profile:
      • Developer (4)

    Reviewed by 8 customers

    Sort by

    Displaying reviews 1-8

    Back to top

    (2 of 2 customers found this review helpful)

     
    4.0

    A Very Handy Addition to my Bookshelf!

    By Cyberherbalist

    from Olympia, WA

    About Me Developer

    Verified Reviewer

    Pros

    • Easy to understand
    • Helpful examples
    • Well Organized
    • Well-written

    Cons

    • Index could be expanded

    Best Uses

    • Expert
    • Intermediate
    • Novice
    • Student

    Comments about O'Reilly Media Regular Expressions Cookbook:

    I got this book hoping to find "recipes" for the various Regex problems I run into in my work, and it has more than fulfilled my expectations. Finding a thankfully clear tutorial on Regexes was an unexpected plus.

    A previous reviewer, Steve of Houston, TX, complained about the recipe numbering scheme, like where the text might say "see Recipes 3.15 and 3.16". He said he couldn't figure out what these numbers meant or where there was a list of them. What?! Did he actually have a copy of the book in hand? The Table of Contents lists each recipe and gives its title. The format is X.Y, where X is the chapter and Y is the individual recipe. If one is referred to Recipe 2.6, it is child's play to turn to chapter 2 and find the sixth recipe. They are clearly marked. This is entirely intuitive, and I cannot understand how he could have missed it.

    (1 of 1 customers found this review helpful)

     
    4.0

    It may have a cute name but gets the job

    By Proffesor

    from Los Angeles, Ca

    About Me Developer

    Verified Reviewer

    Pros

    • Accurate
    • Clear information
    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Expert
      • Intermediate
      • Novice

      Comments about O'Reilly Media Regular Expressions Cookbook:

      Well presented ideas. With clear information. Includes almost every flavor of regular expressions. The newbe or old timer can get good help from this book.

      (3 of 3 customers found this review helpful)

       
      3.0

      Comprehensive but hard to read

      By krzysztof wolowski

      from poland, wroclaw

      About Me Maker

      Verified Reviewer

      Pros

      • Exhaustive

      Cons

      • Difficult to understand

      Best Uses

      • Expert

      Comments about O'Reilly Media Regular Expressions Cookbook:

      I don't think that regular expressions are especially difficult. But I feel that this book could be written in a more user-friendly manner. Although it contains a lot of good recipies and is pretty deep and exhaustive it completely fails to convey this knowledge. Examples are few and far between. Maybe next time these two geeks (I like the software they have developed much more that this book) should take a writer on board.

      (5 of 24 customers found this review helpful)

       
      1.0

      This book is ^*!?

      By Steve

      from Houston, TX

      Verified Reviewer

      Comments about O'Reilly Media Regular Expressions Cookbook:

      Throughout the book there are references to Recipes, However if think you are going to find a sensible referencing methodology you are mistaken. Instead we get things like
      "See Also
      Recipes 2.1, 2.2, and 2.7"

      First I think these are line references that will be cross referenced throughout the book, NO!

      Then I imagine there would be an appendix with these recipes listed at the end of the book, NO!!

      Then I assume that these are actually pointing to the chapter + Section Numbers. NEGATIVE.

      No there does not appear to be a salient discussion of how to use these recipes to refer to anything.

      A far as I can see the Author had some cutesy idea of a COOKBOOK with Recipes, and the editorial staff left out the key ingredient.

      I HATE THIS BOOK,
      HATE IT HATE IT HATE IT!!!!

      (3 of 3 customers found this review helpful)

       
      2.0

      No Examples or sample code available

      By visProcessEng

      from Houston, Tx

      About Me Developer

      Pros

        Cons

        • Not comprehensive enough

        Best Uses

        • Intermediate

        Comments about O'Reilly Media Regular Expressions Cookbook:

        This book is directed at those who are already familiar enough with RegEx that they no longer need it = I suppose that make it a valuable reference book.

        I could have benifited from the promised "examples and additional information." that is absent from the books website (Confimred via email by Oreilly Media book support.

        (1 of 2 customers found this review helpful)

         
        5.0

        Very Helpful

        By php developer

        from plano, texas

        About Me Developer

        Verified Reviewer

        Pros

        • Accurate
        • Concise
        • Helpful examples

        Cons

          Best Uses

            Comments about O'Reilly Media Regular Expressions Cookbook:

            This is a great book if you quickly need a particular regular expression. I also includes a chapter on regular expression basics.

            (4 of 7 customers found this review helpful)

             
            5.0

            Will Pay For Itself In Just One Use

            By Larry

            from Somerville, MA

            Verified Reviewer

            Comments about O'Reilly Media Regular Expressions Cookbook:

            This is the kind of book one doesn't actually read (unless you're a masochist ;-), but is essential to have around. Let's face it, very few of us are good with regular expressions. If you aren't using them every day (which most of us aren't) they are just some kind of black-magic stuff we need to do every now and then.

            From what I've seen the examples and explanations are clearly written, and the fact that they show - and explain - solutions for Perl, .NET, Java, JavaScript, Python and Ruby makes this book too good to pass up.

            (5 of 6 customers found this review helpful)

             
            4.0

            If All You Have Is a Hammer...

            By joshSVUG

            from Undisclosed

            Comments about O'Reilly Media Regular Expressions Cookbook:

            If All You Have Is a Hammer, Everything Looks Like a Nail. If All You Have Is a RegExp Cookbook, does Everything Looks Like a RegExp... well not really!

            The book is well organized and easy to read. Examining the table of contents is a must in order to locate the gems you need to use and tweak. There are a few recipes that will get the work done (of course, these are all subjective and change based on your circumstances).

            What's with all this hammer talk?

            The authors are very clear that some of the RegExp solutions provided are there to illustrate usage but that there are a variety of other tools better suited to perform a certain task. For instance xmllint may be preferred over using "raw" RegExp to validate a file (IMHO)... so, before you run to use an example RegExp from the book, ask yourself is there a better tool for the task at hand?

            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: $31.99
            Formats:  APK, DAISY, ePub, Mobi, PDF

            Available in Multiple Languages