Amazon.com Customer Reviews
Will take you a long way down the rabbit hole - Review written on February 15, 2008
Rating: 3 out of 5
1 customer found this review helpful, 1 did not.
How deep down the rabbit hole do you really NEED to go? I had a serious need to get on top of regular expressions to solve one particular problem. I looked at several online tutorials which didn't take me where I needed to go, so I ordered Mastering Regular Expressions after reading the Amazon reviews. I always look at the negative reviews first. In spite of the negative reviews I ordered the book with an open mind.
When the book arrived I began reading it with enthusiasm. In the preface there is a small section on "How to Read This Book". I bought into the author's suggestion to read the book's first six chapters first. I was captivated through the first three chapters, and then somewhere in chapter 4 I began to get very weary with information overload. After putting the book down for a couple of days I decided to skip the rest and use what I needed to write the one regular expression I had need of. The book did successfully help me accomplish this, so I gave it 3 stars. Not only did it give me the information I needed that the online tutorials didn't, it also gave me the confidence I needed. For that, which I am grateful, I would have liked to have given it more stars. I think many of those in need of learning about regular expression could be well served by a "lite-edition" of this book. Perhaps someday when I have the time and the need I may try to wade through the rest of the book, but as it is now Mastering Regular Expressions took me far farther down the rabbit hole than I really needed or wanted to go.
If you need to get on top of Regular Expressions, I would recommend this book, however just be ready to be taken far deeper than the average coder probably needs to go.
More than expected. - Review written on August 23, 2007
Rating: 5 out of 5
2 customers found this review helpful.
I have been in computer software developer over 7 years now and never really used regular expression until a year ago. True, you can live without it. But, with regular expression at hand, you climb up another level of programming. Code will be much concise and code research will be like a breeze.
Anyway, I didn't read this book entirely since later chapters explain intricacies and subtle differences of each specific language, e.g., java, perl, php, etc. It didn't take long to apply the knowledge I gained to real work and benefit. By the time I completed the first chapter, I already started to get rewards. My life is a lot easier now.
Even with only the first 3 chapters, this book is well worth its price. The author did superb job explaining what's going on behind the scene and guide you through the right way of constructing regular expressions for various situations. Of course, he will show you common pitfalls to avoid, too. Very detailed and comprehensive.
Highly recommended.
VERY VERY HIGHLY RECOMMENDED!! - Review written on May 23, 2007
Rating: 5 out of 5
1 customer found this review helpful.
Are you a programmer working on text-related tasks? If you are, then this book is for you. Author Jeffrey Friedl, has done an outstanding job of writing a cool book that will interest anyone who has an opportunity to use regular expressions.
Friedl, begin with an introduction to the concept of regular expressions. Then, the author takes a look at text processing with regular expressions. Next, the author provides an overview of features and utilities, plus a bit of history. He also explains the details of how regular expressions work. The author continues by working through regular expressions examples. Then, he discusses efficiency in detail. Next, the author covers Perl regular expressions in detail. He then looks at Sun's java.util.regex package. The author continues by looking at .NET's language-neutral regular-expression package. Finally, the author looks at PHP's preg suite of regex functions.
This most excellent book should expand your understanding, even if you consider yourself an accomplished regular-expression expert. Perhaps more importantly, the book concentrates on mastering a particular implementation!
Excellent Resource - Review written on February 04, 2007
Rating: 5 out of 5
3 customers found this review helpful, 1 did not.
Regular Expressions need to be fully mastered in order to truly gain access to the power of many languages and programs. Whether you are working with Perl, PHP, Java, .NET, Ruby, C, Python or any of a variety of other languages the use of regular expressions allows you to work with your data in powerful ways. As a general rule most books that even mention regular expressions just mention a very few of the common ways to build an expression. This book takes the reader well beyond that level and explores the many more unusual ways regular expressions can be used. If you don't know what a regular expression is then you have no need for this book, but if you have ever worked with regular expressions then you are in for a treat with this book. I have used them for years and built a whole spam filter system around regular expressions but there is so much more they can do and this book can make you an expert.
After a basic introduction covering the most common tasks regular expressions are used for (substitution, selection, wild cards, etc.) the author delves into examples of regular expressions in Perl, and follows that with a section discussing some of the variations in regular expressions as implemented in different languages and common programs. One of the most important features of the book is the plethora of real world programming examples. Mastering Regular Expressions is highly recommended to anyone who wants to completely master the full art of regular expressions.
A gem - technical presentation as it should be - Review written on February 03, 2007
Rating: 5 out of 5
3 customers found this review helpful.
Regular expressions are not really for the person playing at would-be programmer. It is to the text processing person what a top-of-the-line drill is to a carpenter. It requires a dedication to detail, an ability to write out exactly what needs to be done and why it works. Regexs are used in a context. Perl for example, helps the process along by supplying a well-packaged and documented environment for regex. But this means you have to learn Perl, or Java, or PHP, Python, Ruby, whatever. This book is for the kind of person that fits somewhere in the above described mix. It is however, THE book to have when you do care enough. It is not an easy book for a beginner or those in a hurry. Whatever it is that is covered here is done well and authoritatively (spelling ?). The author knows his stuff and the pains-taking effort he talks about in his Preface is obvious to the student of the book.
I believe this topic lends itself to being best taught by looking hard at a big bunch of non-trivial examples, with a lot of surrounding comments. They are in the book, I wish there were more. Perhaps the buyers of this book, along with the regex gurus out there could start posting well-crafted regexs to some well-known spot. I believe that O'Reiily, the publisher of this boo already might have such a posting site.
Kudos to O'Reilly and to the author for a wonderful contribution to the computer programmer/science community
Mastering Regular Expressions - A must-read for any savvy power-user - Review written on January 17, 2007
Rating: 5 out of 5
6 customers found this review helpful.
For many savvy computer users, regular expressions embody the perfect utility: a well defined, documented, and designed tool that makes complicated and arduous jobs short and easy. That being said, the craft of regular expressions (hereafter, `regex') makes about as much sense as a foreign language to the uninitiated or novice. Regex have no immediately apparent meaning to those unfamiliar with them, and are so enigmatic in appearance that many users do not even attempt to understand them - writing them off as a tool only for experts. "Mastering Regular Expressions" sets out to not only make regex understandable, but easy to apply to a wide range of situations.
Stylistically and structurally, this is one of the most unique O'Reilly publications I have read. The author even says in the early chapters to think of the book as a novel, and not as a reference (the book's structure doesn't really lend itself to being a reference book anyways). The mindset that the author applies to his writing makes a discernable difference in how the book reads, and it feels more like a chronological story and less like a textbook as a result. Even the quizzes that the author scatters throughout the book are treated as part of the "story", and the solutions are on the very next page rather than in the back of the book or at the end of the chapter. As a result, the book is very easy to read, and flows extremely well. It feels much less like a textbook and more like a narrated lesson from an enjoyable professor.
With a topic as muddy and potentially confusing as regex, I was worried that the text would be just as confusing to follow. However, I was pleasantly surprised. The text itself is very well written, and very clear. There was never an instance in which I had trouble comprehending what the author was trying to communicate, and I almost never had to go back and re-read something multiple times to grasp the concept.
Furthermore, the text is full of excellent examples with accompanying explanations. The author almost exclusively teaches through example, and as a result, most of the lessons are extremely practical and great real-world applications. All of the code examples (of which there are many page-long instances of) are very well documented, and easy to understand.
Regex really is one of the most portable utilities that exists in the UNIX world. It can be applied to an enormous number of situations, and is interoperable with a laundry list of other tools and languages. As such, regex is not only a tool, but a general concept that must be grasped prior to proper usage - and this is what the first several chapters focus on. Thinking about problems in terms of regex is something that takes practice, and does not come easily to most people. This book tends to teach through example, and jumps right into matching simple regex to text lines to demonstrate how regex works. This brings me to my next point.
This book is not for beginners. I cannot stress this enough. The chapters not specifically aimed at a language require solid knowledge of a structured language like C++ or Java. Granted, the book really won't appeal to anyone that doesn't use computers on an advanced level on a regular basis; however, what I want to stress is that regardless of the reader's level of computer experience, if the reader does not have advanced knowledge of text handling in serious computer languages, most of the book's content will be too complex.
On the same note, and this is not a bad thing, about half the book is language-specific. There is a chapter for Perl, PHP, and Java. Obviously, if you don't know these languages, then most of the content of these chapters will be useless. This is not to say that the book will be useless to you if you don't know these languages - the non-language specific chapters occupy a large portion of the book, and contain more than enough material to master regex - however, the reader should be aware that just under half the book is aimed at specific languages.
Overall, this book is nothing short of fantastic. The audience for it is very limited - however, the author manages to make a concept difficult to understand, and even harder to master, easy to read about and learn. Clearly, a lot of thought went into the craft and design of this book, and it shows. I would highly recommend this book to any programmer, system administrator, or computer power user.
From Novice to Expert in a couple of weeks - Review written on December 29, 2006
Rating: 5 out of 5
2 customers found this review helpful.
Incredibly well written and thought out, Mastering Regular Expressions explains both the syntax and philosophy behind regular expressions. You'll find that it is throughly researched, every nuance of a given regex implementation of the four featured languages (Perl, Java, ASP and PHP) is covered in extraordinary detail, containing information available NO WHERE online.
I bought this book after tooling around with regular expressions for a year or so and having limited success, my training having been limited to short online tutorials. After reading Friedl's guide, I have become much better at CORRECTLY programming regular expressions and "thinking regular expressions", that is, changing my outlook on a given task in order to apply regular expressions. I would highly recommend this book to anyone who deals with textual data on a daily basis, including, programmers, web developers and writers of any type.
A Black-Art Demystified! - Review written on November 18, 2006
Rating: 5 out of 5
3 customers found this review helpful.
I don't know about you, but in over 20 years of Unix use and work, I've always had a "problem" with regex. Yes, regular expressions are ANYTHING but "regular!" ...except that the notion extends to parsing text for patterns that are common.
Using regular expressions has always been a hurdle for me. I mean, you HAVE to be able to manage them at least a little in order to be proficient with Unix, but Mastering them, that's another story entirely. Jeff's (if I may call him Jeff) book is stellar. It reads easily and provides meaningful topics on using regex to your advantage.
I can't say enough about how well put-together this book is for the average person. Every topic is clearly visited and the discussion is pleasantly light and, at the same time, technically concise so as to provide real, useful help to using regular expressions. Here is an example:
"Mimicking atomic grouping with positive lookahead"
I consider this book to be a "brain dump" by perhaps the most accomplished regex guy in the industry. In the best of O'Reilly traditions, the book is very well laid out and presented. The quality of editing and "fit-n-finish" of the book are representative of this 3rd Edition.
If you encounter Regular Expressions in your work or as a hobbyist, this book shines a light into the darkness that opens the world of regex to you. It has been very practical and useful for me and it has really helped me be a much better regexer!
Good guide to regular expressions in all kinds of situations - Review written on November 08, 2006
Rating: 5 out of 5
3 customers found this review helpful, 1 did not.
This book is about a very powerful programming tool. Most documentation that mentions regular expressions doesn't even begin to hint at their power, but this book is about mastering regular expressions. Regular expressions are available in many types of tools such as editors, word processors, system tools, and database engines, but their power is most fully exposed when available as part of a programming language. Examples include Java, Visual Basic, Perl, VBScript, JavaScript, sed, and awk. Regular expressions are the very heart of many programs written in some of these languages.
This book will interest anyone who has an opportunity to use regular expressions. If you don't yet understand the power that regular expressions can provide, you should benefit greatly as a whole new world is opened up to you. This book should expand your understanding, even if you consider yourself an accomplished regular expression expert. Programmers working on text-related tasks, such as web programming, will find a gold mine of detail, hints, tips, and understanding that can be put to immediate use. I've not found this level of detail and thoroughness in any other book.
Regular expressions are an idea that is implemented in various ways by various utilities. If you master the general concept of regular expressions, you'll find it easier to use a particular implementation. This book concentrates on that idea, so most of the knowledge presented here transcends the utilities and languages used to present the examples. You'll probably get the most out of this book by reading the first six chapters in sequence. The last four chapters cover regular expression specifics of Perl, Java, .NET, and PHP, and here is where you can skip around based on your need.
Chapter 1, Introduction to Regular Expressions, is geared toward the complete novice. It introduces the concept of regular expressions using the widely available program egrep, and offers the author's perspective on how to think regular expressions, instilling a solid foundation for the advanced concepts presented in later chapters. Even readers with prior experience would do well to skim this first chapter.
Chapter 2, Extended Introductory Examples, looks at real text processing in a programming language that has regular expression support. The additional examples provide a basis for the detailed discussions of later chapters, and show additional important thought processes behind crafting advanced regular expressions. To provide a feel for how to "speak in regular expressions," this chapter takes a problem requiring an advanced solution and shows ways to solve it using two unrelated regular-expression-wielding tools.
Chapter 3, Overview of Regular Expression Features and Flavors, provides an overview of the wide range of regular expressions commonly found in tools today. Due to their turbulent history, current commonly-used regular expression flavors can differ greatly. This chapter also takes a look at a bit of the history and evolution of regular expressions and the programs that use them. The end of this chapter also contains a guide to the advanced chapters. This guide is your road map to getting the most out of the advanced material that follows
Chapter 4, The Mechanics of Expression Processing, ratchets up the pace several notches and begins the central core of this book. It looks at the important inner workings of how regular expression engines really work from a practical point of view. Understanding the details of how regular expressions are handled goes a very long way toward allowing you to master them. The next chapter puts that knowledge to high-level, practical use. Common but complex problems are explored in detail, all with the aim of expanding and deepening your regular expression experience. Chapter 6 looks at the real-life efficiency ramifications of the regular expressions available to most programming languages. This chapter puts information detailed in Chapters 4 and 5 to use for exploiting an engine's strengths and stepping around its weaknesses.
Chapter 7 closely examines regular expressions in Perl, arguably the most popular regular expression-laden programming language in use today. It has only four operators related to regular expressions, but their myriad of options and special situations provides an extremely rich set of programming options and pitfalls. The very richness that allows the programmer to move quickly from concept to program can be a minefield for the uninitiated. This detailed chapter clears a path.
Chapter 8, on regular expressions in Java, looks in detail at the java.util.regex regular expression package, a standard part of the language since Java 1.4. The chapter's primary focus is on Java 1.5, but differences in both Java 1.4.2 and Java 1.6 are noted. Chapter 9 contains the documentation for the .NET regular expression library that Microsoft neglected to provide. This chapter provides the details you need to employ .NET regular-expressions to the fullest regardless of what base language you're working in. Chapter 10 provides a short introduction to the multiple regex engines embedded within PHP, followed by a detailed look at the flavor and API of its regex suite, powered under the hood by the PCRE regex library.
Overall, this is a very complete guide to regular expressions with plenty of examples and I highly recommend it.
Best Title on the Subject - Review written on August 28, 2006
Rating: 4 out of 5
8 customers found this review helpful, 3 did not.
If you have ever been frustrated trying to figure out Regular Expressions (RegEx) based only on a table showing symbols and a few paragraphs of explanations obviously written by someone who assumes you are already familiar with the concept, then this book is for you. Don't be daunted by 480+ page size of this title; before you reach the end of chapter 2 you find yourself with a solid understanding of the concepts, structure, syntax and "keywords" in common use by those utilities, programming languages and applications that incorporate RegExs. The middle of the book covers implementation of RegEx in different environments, techniques for creating the expressions, and methods for creating efficient expressions. The end chapters are specific for Perl, Java, VB.NET and PHP users.
The only minor issues I had was in the tools used to demonstrate the concepts. Although no tool used cost the reader money if they wish to hands-on follow along, some of the downloads are from third-party sites which have no guarantee of offering the download by the time you get the book. Additionally, the author makes heavy use of Perl to demonstrate RegEx in scripting, which is fine for Perl users, but those that use other languages to fend for themselves. Seeing additional examples in other free languages, such as VBScript or JScript would have been nice.
Overall, Mastering Regular Expressions is an excellent choice for both learning the basics as well as better preparing yourself to apply them in real-world situations. The writing style is easy to understand and follow, and the layout allows this book to be a learning resource now, and a decent general reference later.
Mastering Regular Expressions - Review written on August 23, 2006
Rating: 5 out of 5
7 customers found this review helpful.
I've corresponded personally with Jeffrey Friedl several times over the last few years, and I remember being at once impressed with his attention to detail and his focus. I was invited to be one of the technical review editors for this third edition of his authoritative book on Regular Expressions, but had to pass due to time constraints.
However, I am pleased to state that whoever the tech reviewers were, they did a thorough job on this one from O'Reilly. This book has matured over these three editions to become what I would consider the most detailed and valuable book about Regex on the planet - and that means whatever your favorite programming language or platform is.
You see, Regular Expressions is in itself a language, and transcends programming languages and platforms because the concepts are basically the same across all languages - whether it be Perl, JAVA, C#, Visual Basic, Javascript, PHP, Ruby, Python, TCL - you name it.
And this book focuses on the mastery of regex, not being a reference tool. Though each language has a different syntax for handling objects and methods, the underlying objects and methods are the same with Regex, so even complex examples shown in one language directly translate to the other languages.
Suffice to say that there are basic concept chapters that are really language - agnostic, and then specific sections on PHP, .NET, JAVA, and Perl. The book covers practical Regex techniques and most importantly, it gets you to the conceptual level where you can begin constructing Regex patterns on your own, without having to look for "examples".
For .NET developers, Jeffrey provides a complete table-based overview of .NET's Regular Expression flavor, with a focus on the new features available in .NET 2.0, including class subtraction, RegexOptions, and named capture.
In sum, let me just say that any developer who finds the need to manipulate text - whether it be scraping a web page, creating a report, importing data, or a hundred other applications, is going to need Regular Expressions. Jeffrey's book provides a complete and mature approach that is fresh, timely and detailed. I would recommend this book for any developer.
The Bible Of Regular Expressions - Review written on June 09, 2005
Rating: 5 out of 5
6 customers found this review helpful.
Back in 2000 I had to complete some task and another engineer said "Use a Regular Expression". Ignorant of what a regular expression was, I got a quick explanation from the programmer who brought it up, and then I quickly got Perl to do what I needed, learning how powerful regular expressions are. Regular expressions are like that magical elixir, that wonderful little secret that was created to fix specific little problems, and man when you need them, they do the job better than almost any other.
If you are reading this review, you probably have some background as to what regular expressions are, but in a nutshell, they quickly let you find a particular search string and then modify it as needed. Regular expressions have their own ruleset as to how these searches/replacements are performed, and in order to learn how to write good RegExs, you need the book 'Mastering Regular Expressions'. You will not find a Regular Expression reference as good as this book by Jeffery Friedl, and I challenge you to look for yourself!
If you ever need to parse through a lot of data, whether it be logs or just finding a particular piece of code, you will save yourself a lot of time and gain much in performance by learning how to use Regular Expressions to accomplish the task(s) at hand. Having this book by your side will make that journey all the easier, and you will find lots of great examples pre-written, and new approaches as to how to write better RegExs to complete your tasks by having this text by your side. It's binary folks, if you use RegExs in your line of work, you need this book, you will not be let down!!
***** HIGHEST RECOMMENDATION
Still the classic... - Review written on February 24, 2005
Rating: 5 out of 5
[Review of 3rd edition]
I last reviewed this book in early 2005 when it was still in the second edition. But with the release of Jeffrey E. F. Friedl's Mastering Regular Expressions (3rd Edition), I thought it best to give it another look. It's still great, it's still the definitive guide to the subject, and now it gives PHP'ers more to work with...
Contents: Introduction to Regular Expressions; Extended Introductory Examples; Overview of Regular Expression Features and Flavors; The Mechanics of Expression Processing; Practical Regex Techniques; Crafting an Efficient Expression; Perl; Java; .NET; PHP; Index
As with the last edition, you'll find nearly everything you need to know about regular expressions here. Since the general rules of regular expressions haven't changed much, it's not as if you're trying to learn regex version 12.5. The main difference in this edition is that Friedl gave PHP a whole lot more coverage in this update. PHP has become more mainstream over the last year or so, and if that's your area of interest you'll find more examples and guidelines now. Java 1.5 and 1.6 have also emerged since the last writing, so there's a bit more clarification as to how regex coding has changed (not much).
My initial recommendation hasn't changed one bit... If you do anything with regular expressions in your programming, get this book, put your name in it, and don't let others borrow it...