|
|||||||||||||||||||||||||||||||||||
|
7 Reviews
|
Average Customer Review
Share your thoughts with other customers
Create your own review
|
|
Most Helpful First | Newest First
|
|
20 of 20 people found the following review helpful:
4.0 out of 5 stars
Grab bag of commonly used regular expressions,
By Jack D. Herrington "engineer and author" (Silicon Valley, CA) - See all my reviews (VINE VOICE) (REAL NAME)
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.
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.,
By
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.
12 of 12 people found the following review helpful:
4.0 out of 5 stars
Regular Expressions for the Beginner,
By Robert L. Stinnett (Boonville, MO) - See all my reviews (VINE VOICE) (TOP 1000 REVIEWER) (REAL NAME)
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.
15 of 17 people found the following review helpful:
3.0 out of 5 stars
Too much source code, not enough regular expressions,
By
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
When I saw the title of this book, I was excited at the prospect of a book filled with detailed regular expression examples. Unfortunately, it didn't pan out that way.
Spread over 285 pages, the book lists 100 tasks that you can accomplish with regular expression. As the solution, the author not only gives a regular expression, but also a complete source code snippet in Perl. Most of the recipes also show the same solution (using the same regular expression) in a different programming language. Many recipes have solutions in PHP or Python. Some also have solutions for Vim (a UNIX text editor) and UNIX shell scripting. Obviously, the examples have a heavy bias towards UNIX and open source. If you're a Windows programmer, you may want to look at "Regular Expression Recipies for Windows Programmers" instead. It's essentially the same book, with almost the same list of recipes, but with the examples redone in C# and VB. Each recipe also has a "how it works" section, essentially transcribing the regular expression in English. Most of the recipes solve rather basic problems, organized in six chapters. The first, "Words and Text", deals with finding blank lines, repeated words, words at the start or end of a line, etc. The "URLs and Paths" chapter has examples for finding URLs and file paths, and extracting bits from them. The "CSV and tab-delimited files" has a few recipes for converting between the two and extracting fields. The "Formatting and Validating" chapter shows how to validate numbers, currency, dates, phone numbers, addresses, etc. The "XML and HTML" chapter has recipes for matching and replacing tags and attributes. Finally, "Coding and Using Commands" has some recipes for manipulating source code files, and for parsing the results of various UNIX system commands. The book would have been a better deal if it had focused on regular expressions, and left out the many lines of Perl source code. Not to mention the fact that many examples have equivalent source code listings for PHP and/or Python as well. Without the source code, a book of the same size could easily contain 250 examples. That would have made it far more useful for programmers who know how to program, but aren't well-versed in regular expressions. As it is, I can only recommend this book to people who are not only new to regular expressions, but also relatively new to programming. The book does contain many recipes that solve basic problems you're likely to encounter when writing scripts for a web site in Perl, PHP or Python. If you happen to use one of these languages, and are looking for a cookbook approach, you'll certainly find the book useful. But don't expect to really learn how regular expressions work from this book. (...)
4.0 out of 5 stars
Regular Expression 101,
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
If you have trouble understanding regular expressions then this book will clear all that up. This was an invaluable resource for quickly adding some regulard expressions to a project I was working on. Expression strings can be tricky to undertand at times, this book gave great details into what each piece of the expression string would match on. This resource saved my team a few hours of research, trial and error time, by giving us a great basis to start from. Another excellant resource to have on you shelf.
1 of 2 people found the following review helpful:
4.0 out of 5 stars
Nice bridge between learning and doing...,
By Thomas Duff "Duffbert" (Portland, OR United States) - See all my reviews (VINE VOICE) (TOP 500 REVIEWER) (HALL OF FAME REVIEWER) (REAL NAME)
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
Regular expressions are very powerful, but extremely cryptic to read and/or understand. Nathan A Good's book Regular Expression Recipes - A Problem-Solution Approach (Apress) does a good job in showing you practical applications of regular expressions in multiple languages.
Chapter List: Words and Text; URLs and Paths; CSV and Tab-Delimited Files; Formatting and Validating; HTML and XML; Coding and Using Commands; Index Good basically takes a number of sample problems, like finding similar words or validating U.S. dates, and then shows how the task can be done in various languages using regular expressions. Most of the solutions have two or more language examples: Perl, PHP, Python, Vim, GNU grep, or sed. In addition to showing you the statement that will do the task, he also gives a brief explanation on how the statement works and why it does what it does. This definitely wouldn't be the book you'd get in order to learn about regular expressions, but it'd be the perfect bridge between learning and doing. As you can tell by the list of languages, you probably won't find this as helpful if you're more interested in Java or JavaScript regular expression processing. But even then, you'll at least get the general idea of how a regular expression could be written to do a certain task, and it may spark your imagination on what it would take to apply that technique to your language of choice. Nice practical book, and one that would be useful for anyone who lives in the regex world...
2 of 4 people found the following review helpful:
5.0 out of 5 stars
One of the best guides available,
This review is from: Regular Expression Recipes: A Problem-Solution Approach (Paperback)
Whether you are using Perl, PHP, Python, grep, sed, or any other program that uses regular expressions you will eventually have a problem trying to figure out just how to do something. That is where this book comes in handy. If you need to resolve a peculiar programming problem then this is the book you will want by your side. If the expression doesn't work, or doesn't provide the correct output this is the best place to turn to figure out what is going on. Or, if you want to do something different then you might want to turn here first to look for ideas on how to attack the problem. Since this is a problem and solution oriented approach it provides a solution in Perl, PHP, Shell Script, and Vim. Regular Expression Recipes: A Problem-Solutions Approach is a highly recommended resource and does an excellent job of describing in plain English how to define the problem, how to work on it, and how to get the results you want. This is the ultimate guide to regular expressions.
|
|
Most Helpful First | Newest First
|
|
Regular Expression Recipes: A Problem-Solution Approach by Nathan A. Good (Paperback - April 5, 2006)
Used & New from: $4.25
| ||