Sell Back Your Copy
For a $0.06 Gift Card
Trade in
Have one to sell? Sell yours here
Regular Expression Recipes: A Problem-Solution Approach
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Regular Expression Recipes: A Problem-Solution Approach [Paperback]

Nathan A. Good (Author)
4.0 out of 5 stars  See all reviews (7 customer reviews)


Available from these sellers.



Book Description

April 5, 2006

Regular Expressions are an essential part of programming, but they are hard to come to grips with, aren't they? Fortunately, we have the answer for you! Open Source Regular Expression Recipes provides you with all the open source regular expressions you'll ever need, and explains how to use each one. This way, you can learn by example, rather than muddling through endless pages of syntax explanation.

Concise syntax references are included only when necessary. Languages covered include Perl, PHP, grep, vim, Python, and shell. Web and applications developers, and system administrators will find the examples both accurate and relevant. And this book acts as a useful reference to keep handy for those moments when an answer is needed fast.



Editorial Reviews

About the Author

Nathan A. Good lives in the Twin Cities area of Minnesota. He is a contractor with Alliance of Computer Professionals in Bloomington. When he isn't writing software, Nathan enjoys building PCs and servers, reading about and working with new technologies, and trying to get all his friends to make the move to open source software. When he's not at a computer (which he admits is not often), he spends time with his family, at his church, and at the movies.

Product Details

  • Paperback: 289 pages
  • Publisher: A-Press; 1 edition (April 5, 2006)
  • Language: English
  • ISBN-10: 159059441X
  • ISBN-13: 978-1590594414
  • Product Dimensions: 9.4 x 7.1 x 0.8 inches
  • Shipping Weight: 1.3 pounds
  • Average Customer Review: 4.0 out of 5 stars  See all reviews (7 customer reviews)
  • Amazon Best Sellers Rank: #1,250,916 in Books (See Top 100 in Books)

More About the Author

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

7 Reviews
5 star:
 (1)
4 star:
 (5)
3 star:
 (1)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.0 out of 5 stars (7 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

20 of 20 people found the following review helpful:
4.0 out of 5 stars Grab bag of commonly used regular expressions, December 28, 2004
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
This is the cookbook approach to regular expressions. Nathan gives a bunch of common scenarios (parsing filenames, CSV, validating emails and SSNs) and gives us the expression in Perl. Followed by a discussion of the code, and further examples in PHP, shell script, VIM and others.

There is a small section at the beginning to teach you the fundamentals. But there is nothing at the level of Mastering Regular Expressions (O'Reilly), the classic work in the field.

This book is a good reference for those more interested in simply getting the job done, than in understanding how or why the pattern works. There are some bad examples. In particular the Spam filter example is almost worthless. But most of the examples are well written.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


12 of 12 people found the following review helpful:
4.0 out of 5 stars A cookbook of useful regular expressions for Perl and more., March 18, 2005
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
If you spend time working writing applications that have to do pattern matches and/or replacements, you know about some of the intricacies of regular expressions. For many people they can be an arcane hodgepodge of odd characters, but they don't have enough time (or interest) to really understand how to code them. Nathan A. Good has written <cite>Regular Expression Recipes: A Problem-Solution Approach</cite> for those people. In its relatively slim 289 pages, he offers 100 regular expressions in a cookbook format, tailored to solve problems in one of six broad categories (Words and Text, URLs and Paths, CSV and Tab-Delimited Files, Formatting and Validating, HTML and XML, and Coding and Using Commands).
Regular expressions are not restricted to just the Perl or shell environments, so Nathan offers variations for Python, PHP, and VIM as well. In most cases the translation is relatively straight-forward, but in a few cases a different environment may have (or lack) additional facilities, prompting a different expression to do the same task.
Before you even read chapter 1, Nathan provides a quick summary course on regular expressions, with detail given to each of the five environments you might utilize. He has written the syntax overview in a highly-readable format, making it easy to understand the gobbledy-gook of the most bizarre concoctions you might encounter.
In each chapter, Nathan gives examples of how to find single words, multiple words, and repeated words, along with examples of how to replace various detected strings with others. In each case he gives an example of its use for each platform, followed by a bit-by-bit breakdown of how it works. Not every environment is given on every example, and in many cases the "How It Works" section refers to the first one, as most REs are identical between the platforms.
First, I must admit that there are a number of useful solutions provided, especially for someone who is concerned with application and web development. However, I did feel a little cheated by the fact that several chapters covered essentially the same task, with only minor variations. It almost seemed as though the author was trying to pad out the solution count to the magic number 100. A simple example: three solutions in chapter one cover (a) replacing smart quotes with straight quotes, (b) replacing copyright symbols with the (c) tri-graph, and (c) replacing trademark symbols with the (tm) sequence. Did we really need three separate chapters for that? I don't think so.
Another quibble revolves around some of the coding of the expressions. Nathan has made liberal use of the non-capturing groups to insure only the items that needed replacement were captured. While a worthy idea, in some cases the expression may have been simplified for understanding. Another issue is a slight error in searching for letters. In a number of expressions, Nathan uses [A-z] to capture all letters. Unfortunately, the special characters [, \, ], ^, _, and ` occur between upper-case Z and lower-case a, making it match too much. Either [[:alpha:]] or [A-Za-z] should have been used.
Despite a couple of quibbles, <cite>Regular Expression Recipes</cite> does provide a useful compendium of solutions for common problems developers face. Presenting the information in a cookbook fashion, along with insuring that those using something other than Perl don't have to sweat translating the expressions to their target language, makes this a handy book to have. I wouldn't hesitate to recommend it.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


12 of 12 people found the following review helpful:
4.0 out of 5 stars Regular Expressions for the Beginner, January 2, 2005
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
In "Regular Expression Recipes" the author does a good job of cutting away the sometimes tedious and at sometimes overwhelming job of teaching the reader every in and out of regular expessions and instead focuses on providing practical, real-world examples that the reader can try in a variety of languages and see instant results.

No doubt, one of the strengths of this book is that is takes Regular Expressions and demonstrates them not in just one language but in several (Perl, Python, PHP, grep, sed and Vim). In this way, a reader who is familiar with any of these languages can catch on and understand what is happening without having to learn yet another syntax just to understand the basics of regular expressions.

The book itself is categorized into different topics with an index system that makes it easy to jump to right what you are most interested in. When the author covers a topic, such as Reformatting Last Names, he also cross-references other useful, related regular expressions that the reader may also have an interest in given the topic.

Of particular interest to those new to the Regular Expression field, the author does a good job of explaining in everyday terms how an expression works. One of the drawbacks of many RegEx books is that often you cannot grasp exactly why a certain syntax works because of the complexity of the problem.

The only lacking spot in this book is that it does not include any "real" output of running the regular expressions; however given the content and ease-of-use of the book, this is but a small caveat that should not impact most readers.

Overall, a wonderful reference that explains Regular Expressions in terms that most beginning and intermediate users will enjoy and learn from.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews





Only search this product's reviews



What Other Items Do Customers Buy After Viewing This Item?


Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums


Listmania!


So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject