CARVIEW |
Regular Expression Pocket Reference, Second Edition
Regular Expressions for Perl, Ruby, PHP, Python, C, Java and .NET
By Tony Stubblebine
July 2007
Pages: 126
ISBN 10: 0-596-51427-1 |
ISBN 13: 9780596514273
(Average of 3 Customer Reviews)
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.
Full Description
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
Featured customer reviews
The best regex ref available, May 20 2008
Submitted by Brianary [Respond | View]
I finally created a reference for Visual Studio's NIH RegEx Syntax (https://brianary.blogspot.com/2008/05/visual-studios-nih-regex-syntax.html) .
Good book for well-versed developers in multiple programming languages, September 04 2007





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.
The best regex ref available, August 21 2007





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 askaninja.com) -- essential for readable, maintainable regular expressions.
A book everyone should own.
Excellent reference for regular expressions in several languages, July 30 2007





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.
Media reviews
"Regular expressions have proven so popular that they have been incorporated into most if not all major programming languages and editors, and even at least one Web server. But each one implements regular expressions in its own way which is reason enough for programmers to appreciate the latest edition of Regular Expression Pocket Reference by Tony Stubblebine."
-- Michael J. Ross, Web Developer, Slashdot.org
"This is a handy little guide for common regular expression fundamentals and odds and ends. The intro chapter does a nice job of giving you the regex elevator speech and hits all the important fundamentals: different engines, metacharacters, and general pattern rules...Each chapter is concise, well-written, and hits the major things you'll need to refresh your memory on from time to time. Overall it's a very well-done book."
-- James Holmes, Amazon.com
"Gawd, I hate doing regular expressions. Don't you? As far as I am concerning, any help is good help."
-- Brett Merkey, Amazon.com
Read all reviews

"Regular expressions have proven so popular that they have been incorporated into most if not all major programming languages and editors, and even at least one Web server. But each one implements regular expressions in its own way which is reason enough for programmers to appreciate the latest edition of Regular Expression Pocket Reference by Tony Stubblebine."
--Michael J. Ross, Web Developer, Slashdot.org
![]() ©2009, O'Reilly Media, Inc. (707) 827-7000 / (800) 998-9938 All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. |
About O'Reilly
Academic Solutions Authors Contacts Customer Service Jobs Newsletters O'Reilly Labs Press Room Privacy Policy RSS Feeds Terms of Service User Groups Writing for O'Reilly |
More O'Reilly Sites
O'Reilly Radar Ignite Tools of Change for Publishing Digital Media Inside iPhone O'Reilly FYI makezine.com craftzine.com hackszine.com perl.com xml.com Partner Sites InsideRIA java.net |
Content Archive Business Technology Computer Technology Microsoft Mobile Network Operating System Digital Photography Programming Software Web Web Design |