Learning Regular Expressions 1st Edition, Kindle Edition
The Amazon Book Review
Book recommendations, author interviews, editors' picks, and more. Read it now.
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
To get the free app, enter your mobile phone number.
About the Author
Ben Forta is Adobe Systems’ Senior Director of Education Initiatives. He is also the author of numerous books on SQL, regular expressions, ColdFusion, Windows development, JSP, and more. His book Teach Yourself SQL in 10 Minutes is the best-selling book on SQL of all time.
--This text refers to the paperback edition.
- Publication Date : May 1, 2018
- File Size : 4016 KB
- Word Wise : Not Enabled
- ASIN : B07CGNFKQ4
- Print Length : 144 pages
- Publisher : Addison-Wesley Professional; 1st Edition (May 1, 2018)
- Text-to-Speech : Enabled
- X-Ray : Not Enabled
- Language: : English
- Enhanced Typesetting : Enabled
- Simultaneous Device Usage : Up to 5 simultaneous devices, per publisher limits
- Page Numbers Source ISBN : 0134757068
- Screen Reader : Supported
- Lending : Not Enabled
- Best Sellers Rank: #707,994 in Kindle Store (See Top 100 in Kindle Store)
- Customer Reviews:
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Ben Forta’s Learning Regular Expressions, published by Addison-Wesley, aims to change this, and for the most part does an excellent job. Situated somewhere between the first page of Google search results for “regular expression” and Jeffrey Friedl’s Mastering Regular Expressions, it provides a step-by-step tutorial on using regular expressions to match text. Illustrated with common problems including matching phone numbers, postal codes (from three different countries, an nice addition to the tried-and-true example), email addresses, URLs, and snippets of HTML.
The book’s chapters are structured as lessons, each adding on to what you’ve learned in previous chapters. A careful study of the material and working of the examples will bring you not just a basic understanding of word and pattern matching, but more advanced use of regular expressions including position matching, backreferences, look-ahead and look-behind, and even conditional embedding. I’ve been using regular expressions (poorly, I admit, for the most part) for thirty years, and I had several “Oh, that’s how you can do that” moments when reading, especially the last few chapters.
Each chapter provides a set of increasingly sophisticated examples. I hesitate to call this a cookbook, because a competitor I will not name has largely co-pted that format, and truthfully, it’s more didactic than culinary. The presentation works, however; for each section, you’re presented with a problem, some sample text, a regular expression that may or may not solve the problem, and then a discussion of the regular expression and why it did or did not work. Including regular expressions that do not satisfy your goal permits Forta to link one section to another, building on your expectation of how things might work to how they do work. It turns out to be an effective way to present the material, and it’s easy to follow along using a tool such as grep.
The book closes with an appendix on the differences between several popular evironments’ implementation of regular expressions. This is helpful, because almost every reader will come to the book with a slightly different expectation of where they will be using what they learn.
I found Forta’s step-by-step presentation refreshing without being condescending. I would have preferred perhaps a few additional examples on some of the more advanced topics, like look-ahead and look-behind, and even subexpressions. However, he does the job and does it quickly; a motivated reader can go from knowing nothing about the subject to being proficient in just a few evenings, and I found it a quick read.
Top reviews from other countries
I read it on the Windows Kindle and the Kindle Web Reader. In the Web Reader, the code cannot be copied to be tested. In the Windows Kindle, we can copy the code but a copyright notice is always added.
I should mention two problems:
1. The code and the result are not always correct. More often, the explanations are more precise than the code or the result. You have to check constantly.
2. The author decides that a feature is not implemented enough to be explained. In my case, all the languages, the tools and text editors I use were supporting those features. And, most programmers will download a library in order to complete its own tools. Many are complex and would profit from a good pedagogue like this author, albeit a little lazy.
It's a good book for someone who want to have a better understanding of more advanced features. But if you want to know the limits of the regular expressions, you will be left in the dark because too many features are not explained:
- accented characters and national character sets
- union and intersection in character classes
- \A and \G boundary matchers
- Greedy and lazy quantifiers are not defined in the same manner as in Java
- Reluctant and possessive quantifiers
- Named capturing groups
- Flags (minimally covered), and flagged groups
- Independent non-capturing groups
- Replace (very minimally covered)
- Zero-length match
For example, I still don't know what I cannot do with regular expressions. I didn't solve my problem which seems to require a variable length negative lookbehind condition. It is mentioned that for lookbehind condition, only fixed length are supported. But what can we do when you have a variable length condition? I still have to search by myself.
The writing style is clear and the content is well structured with plenty of examples for each topic.
I am happy with my purchase.