Mastering Regular Expressions: Understand Your Data and Be More Productive
W**S
Excellent reference.
I am drawn to report on a book I have owned for many years, because it seems to have fewer stars here than it deserves. I think this is because of problems some folks have had with electronic formats. I do see their point, but this is unfair to the editorial content.So. The following applies to the *paperback* book.In practice Freidl's book is primarily a programmer's reference. But like the best references (eg the C Programming Language) is formatted as a tutorial.Introductory chapters establish a need for regexs, giving a brief history and presenting some straightforward use cases.Thereafter Mr Freidl wades deeper into the waters of obscurity, and we are soon dealing with the minutiae of mode modifiers and greedy versus lazy quantifiers.Some of this stuff goes rather deeper than I have ever needed to go. For example, opening the book at random to page 245, I read the subheadings 'Pre-check of required character/substring optimization' and 'Length-cognizance optimization'. Not of immediate use to me, but I am glad to know where I can find this if ever (heaven forfend) the performance of my application depends on the construction of regexs.The last chapters of the book deal with the respective peculiarities and APIs of the regex implementations of Perl, Java, .NET and PHP. This last bit feels a little out of date - an updated edition would, I suppose, highlight JavaScript and other languages that have become important or gained regex implementations since the 2006 edition, eg C++ 11 and even Delphi. Meanwhile Perl's star has faded somewhat since the book was last revised; perhaps it should no longer be the 'default' language of example?But this is nit-picking. I dare say it is possible to resolve any regex difficulty with a little applied Googling; but to have this book on your shelf is to know that you have an articulate, clear and complete explanation close to hand.
P**R
Very thorough introduction into regular expressions
I bought this book to help build up an understanding of regular expressions (regex), after finding the information on the internet confusing and fragmented. This book does a good job of explaining regex, it's benefits, it's uses and various implentations. I initially needed the book to be able to identify specifc content in emails (dates/product numbers), but now find I use them all the time when working with text for anything but the most basic string operations.Would recommend this for any programmer who does not already know regular expressions or that needs to get a thorough understanding. As long as you use strings you will be able to draw some benefit.As for me, I wonder how I ever managed without!
R**Z
Five Stars
Great book, must have for those serious about scripting and text parsing.
D**N
Five Stars
A perfect book to start to manage RegEx!
M**N
One of the best technical books I've ever owned
Before reading the book I thought I knew regular expressions (ala the xkcd comic); the main reason for purchasing this was to try and learn how to optimise patterns I was making.Having read the book I can safely say that I knew how to use regex in fairly complex scenarios, but I didn't how it actually worked - this book teaches you how the matches are actually made by the engine and shows you how to exploit this knowledge to get the fastest matches.Reading through the book you can see a lot of work has gone into its production - there are a lot of thoughtful inter-relating examples; content is well laid out and there are quite a lot of useful diagrams at different points throughout the book.Even if you think you're a regex hot shot you should still buy this book, you won't regret it!(if you know regex before reading the book I'd recommend taking the author's advice and reading the book fully - it may feel like he's covering stuff you already know but he includes useful titbits of information along the way)
T**Y
Poor quality print-on-demand publication
O'Reilly appears to have abandoned traditional offset printing and is now using a very poor-quality print-on-demand system. The result is that the pages look like fairly bad photocopies which are hard to read.I'll be avoiding all O'Reilly manuals from now on (unless I can track down one of the older properly printed ones), which is a pity because the content is well-written. The poor print quality does a great disservice to the author.
J**E
the book is great; but the Kindle edition did not receive enough care
al the examples in tables were cut ouso one couldn't figure out what the sentence actually meant making all practical examples useless and all information presented in tables equally uselessquickly browsed and immediately requested a refund when i noticed this
B**N
The Regex Manual
Most regex books, blogs, websites, tutorials and classes cover “just the basics” really. Even the ones that say “advanced” often barely get into lookarounds.This book is the definitive guide on regex. Full stop. I’m not quite halfway through and it has already increased my understanding of regex in ways I hadn’t imagined possible. That said, the 3rd edition is 16 years old and it shows. The author regularly references now out-of-date technologies (e.g., PHP and Tcl). But that in no way hampers his ability to teach and ingrain the material. One just simply needs to understand that due to its age, some claims may no longer be true.For example, (and bare in mind I’m halfway through so I don’t know what I don’t yet know) there’s a chart stating that MySQL’s regex engine is a DFA. From what I’ve read, and knowing that MySQL “upgraded” their regex support in version 8, I believe it may now be an NFA. Or, at the very least, a hybrid. I could be wrong, but the point is, before reading this book, I wouldn’t have understood enough to even make that guess.Now, will I skip the chapters that focus on PHP and Tcl? Perhaps the latter. It’s not like I can’t come back and read it later if I find myself ankle-deep in Tcl regex one day. I could say the same for PHP, but it’s in a lot of legacy software, so a quick read through it is probably worthwhile.Not to keep bringing it up, but even halfway through, my understanding of lookarounds increased substantially. I use all of them regularly, but with a half-understanding of what was going on or why it would work sometimes and others not. Beyond that, greedy/lazy/possessive quantifiers… grouping. Sure, I’ve used them at some point. Some more often than others and with more understanding. But now? I get it all.It’s kind of a shame. I don’t have to write regex every day and when I do, it’s usually file searching, so it’s throw-away code. However, I haven’t yet read the chapters on efficiency, so perhaps my knowledge will grow in that area and that will pay off daily!Anyway, if you have any regular use of regex, this book is worth it. I picked up a used copy. I’d have paid cover price ($44.99 USD) easily knowing what’s actually in the book, how it’s written, etc. That brings me to my final point. The author does an amazing job of keeping what could be a very dry subject fresh and clear. You just can’t appreciate that enough.
S**
Comprehensive and detailed, a book you need to have if you're serious about learning regex
This book has to be one of the best technical books I've read in many years. The author has gone to great lengths to explain how regular expressions work. The simple language allows the reader to understand and follow his train of thought. REGEX examples are all based on Perl, and you might find this annoying. However, I write simple scripts in Python and can follow the logic, so I re-write the examples. I wish everyone wrote technical books like Mastering Regular Expressions. Thank you, Jeffrey, for such a fantastic book.
L**N
Livro excelente
Ensina com maestria coisas que eu não sabia que não sabia. Não se limita a ensinar expressões regulares para o uso cotidiano; mostra também como as expressões são processadas e compara explicando a diferença de performance de diferentes patterns.
C**N
Libro básico ...
... para cualquier lenguaje de programación
E**D
Probably the best tome on Regex there is
Probably the best tome on Regex there is. Covers just about every Regex flavor there is and their nuances. Reading through just a few chapters should whip you into good enough shape to apply intermediate to complex Regex patterns to the most common scenarios.Friedl exposes the internals of the most common Regex engine implementations.Whether you apply Regexes now and then, are a sysadmin, or are ramping up on work that demands Regex smarts, you will benefit greatly from this book.
Trustpilot
1 day ago
3 days ago