Regular Expression Pocket Reference, 2nd Edition
Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET
Publisher: O'Reilly Media
Final Release Date: July 2007
Pages: 128

This handy little book offers programmers a complete overview of the syntax and semantics of regular expressions that are at the heart of every text-processing application. Ideal as a quick reference, Regular Expression Pocket Reference covers the regular expression APIs for Perl 5.8, Ruby (including some upcoming 1.9 features), Java, PHP, .NET and C#, Python, vi, JavaScript, and the PCRE regular expression libraries.

This concise and easy-to-use reference puts a very powerful tool for manipulating text and data right at your fingertips. Composed of a mixture of symbols and text, regular expressions can be an outlet for creativity, for brilliant programming, and for the elegant solution. Regular Expression Pocket Reference offers an introduction to regular expressions, pattern matching, metacharacters, modes and constructs, and then provides separate sections for each of the language APIs, with complete regex listings including:

  • Supported metacharacters for each language API
  • Regular expression classes and interfaces for Ruby, Java, .NET, and C#
  • Regular expression operators for Perl 5.8
  • Regular expression module objects and functions for Python
  • Pattern-matching functions for PHP and the vi editor
  • Pattern-matching methods and objects for JavaScript
  • Unicode Support for each of the languages
With plenty of examples and other resources, Regular Expression Pocket Reference summarizes the complex rules for performing this critical text-processing function, and presents this often-confusing topic in a friendly and well-organized format. This guide makes an ideal on-the-job companion.
Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews


by PowerReviews
oreillyRegular Expression Pocket Reference, 2nd Edition

(based on 4 reviews)

Ratings Distribution

  • 5 Stars



  • 4 Stars



  • 3 Stars



  • 2 Stars



  • 1 Stars



Reviewed by 4 customers

Sort by

Displaying reviews 1-4

Back to top

(1 of 1 customers found this review helpful)


DOES include C library documentation

By Franko

from New York

About Me Developer

Verified Reviewer


  • Concise
  • Helpful examples


    Best Uses

    • Expert
    • Intermediate

    Comments about oreilly Regular Expression Pocket Reference, 2nd Edition:

    Contrary to what is implied in a previous review, this does actually include information about a C library: PCRE.

    It's terse but concise. You do need to be familiar with the language or tool for each section that is being referred to, since the examples and notes assume a reasonable degree of familiarity with the concepts.

    Excellent summary of the language specific libraries of you're already familiar with RE, but a terrible learning tool if you're not. Don't expect it to be that.

    (1 of 2 customers found this review helpful)


    Good book for well-versed developers in multiple programming languages

    By joshSVUG

    from Undisclosed

    Comments about oreilly Regular Expression Pocket Reference, 2nd Edition:

    From the back cover of the Regular Expression Pocket Reference: "Ideal as a quick reference," and ", makes an ideal on-the-job companion." All this is true if you are well-versed in regular expressions and use multiple programming languages (and confuse the syntax).

    I like the use of the same examples across programming languages (where applicable).

    The recipes in the cookbook section are great, although I would have liked to see additional recipes (like stripping HTML tags, matching credit card numbers etc,). Of course the examples are endless and over time one builds his/her own recipe collection. At least this is a good place to start.

    (3 of 4 customers found this review helpful)


    The best regex ref available

    By Brianary

    from Undisclosed

    Comments about oreilly Regular Expression Pocket Reference, 2nd Edition:

    This book is the best regex ref I've seen.

    The Introduction to Regular Expressions and Pattern Matching does an excellent job of covering the features common to most regex engines, plus the POSIX character classes and the Unicode properties, which I use infrequently enough that I can never remember. The recipes section will be extremely useful to those with limited experience.

    The only regex engines not covered, that I know of, are the variants in the Windows findstr utility (a subset of stuff in the intro) and the bizarre dialect used by the VisualStudio editor.

    The latter would be the most welcome addition, since I can never remember the syntax. I suspect it is completely different from any other regex syntax to facilitate searching and replacing text in .NET regular expressions, as well as code, though I'd much rather add the extra backslashes than try and get used to the idea of : as an escape character and { } for grouping.

    This ref is otherwise definitive, in my experience. It even documents the upcoming changes in Perl 5.10 (separately from 5.8, which I am thankful for), such as named submatches.

    Another critical piece of info included for each language is the raw string syntax (none for Java, alas, meaning a Java regex to match a Windows path has more backslashes than -- essential for readable, maintainable regular expressions.

    A book everyone should own.

    (3 of 3 customers found this review helpful)


    Excellent reference for regular expressions in several languages

    By jdruin

    from Undisclosed

    Comments about oreilly Regular Expression Pocket Reference, 2nd Edition:

    This book is the best reference for regular expressions. The second edition came out in July 2007 and has several updates over the previous version. The reason for the books ease-of-use lies in the organization. The chapters represent one language each. For each language, listings of the meta-characters and examples are shown. Depending on the language being displayed, there are other subjects covered such as unicode support, object orientation, and different topics unique to the language. The primary parsing engine is listed at the beggining of the chapters with the examples arranged at the ends of the chapters. I generally need to look up expression for JavaScript and .NET. Both of these are covered plus perl, java, php, python, ruby, pcre, apache, vi and shells. I just bookmark the 2 areas I need and I can lookup the expression listing in a few seconds.

    Displaying reviews 1-4

    Back to top

    Buy 2 Get 1 Free Free Shipping Guarantee
    Buying Options
    Immediate Access - Go Digital what's this?
    Ebook: $11.99
    Formats:  DAISY, ePub, Mobi, PDF
    Print & Ebook: $16.49
    Print: $14.99

    Available in Multiple Languages