Most Helpful Customer Reviews
|
|
2 of 2 people found the following review helpful:
3.0 out of 5 stars
Not perfect, but useful for Java developers new to reg. expr, 26 Jan 2005
The book consists of 250 pages of wide-spaced text, split into 5 chapters. The first chapter is an introduction to regular expressions, explaining basic regular expression syntax. The book's pace is relatively slow, which may suit some people but not others. It doesn't explain many of the "gotcha's" or differences between regex flavors. Clearly, this book is aimed at people who are relatively new to regular expressions, and only plan to use them with Java.The second chapter is the most useful part of the book. It describes all the classes in the java.util.regex package, and nearly all of their methods. Most of the descriptions come with example Java source code illustrating its use. If you prefer to learn by reading Java source code rather than English, you'll appreciate these code snippets. The third chapter explains advanced regular expression syntax, such as lazy and possessive quantifiers (called "qualifiers" in the book), and lookaround. Unfortunately, the quality of the book starts to go downhill from here. Minor errors such as using alternation (I|i)ce instead of a far more efficient character class [Ii]ce (page 104) or stating that \d represents a digit in the replacement text (page 107; \d only works in the regex, not in the replacement) could be attributed to sloppy editing. But the example that was intended to explain positive lookahead (page 130) is simply wrong. The regex (?=^255).* does exactly what ^255.* does. The crucial aspect of lookahead (it doesn't consume the text it matches) is completely irrelevant in this example. The fourth chapter could have easily been omitted from the book. It talks more about object-oriented programming techniques than about regular expressions. Some of the advice is questionable. The author suggests storing regular expressions in external files, so they can be edited without recompiling the application. The problem with this advice is that the regular expressions will then sit in an external file without context, making them much harder to understand. It contradicts the books key selling point: most concepts are explained with regexes used in Java code. If another programmer has to maintain the code later, a better idea is to use a tool such as RegexBuddy to insert a detailed English description as a Java comment into the Java source code (RegexBuddy generates them on the Use tab). The fifth chapter presents you with several more elaborate examples performing a number of real-world tasks with regular expressions in Java. While the examples are relatively simple, they do bring everything together nicely. Should you buy this book? While it's definitely not perfect, I would recommend this book to Java developers who are experienced with Java, but have little or no experience with regular expressions. The book's description of the java.util.regex package is far more detailed than documentation included with the JDK. But to learn the ins and outs of the regular expression syntax itself, you'll need to complement this book with another resource
|
|
|
1 of 1 people found the following review helpful:
5.0 out of 5 stars
Excellent tutorial and reference, 3 April 2004
This book is an excellent introduction to regular expressions in general and the Java regex package in particular. The author assumes that the reader has no experience with regular expressions so even if the subject is completely new to you, you will be able to follow along easily. The book approaches the topic in a clever way that makes it both an excellent tutorial as well as an excellent reference to keep nearby. The first chapter covers regular expression syntax. The second chapter looks at the two main classes, Pattern and Matcher, and discusses each of the methods in these classes. The way the information is presented makes it a perfect tutorial, as the methods are introduced in a sensible order that allows the detailed discussion to build. At the same time, since each method is discussed with excellent description and examples, it serves as a useful reference. Chapter three looks at some advanced topics such as groups, qualifiers, and lookaheads. In chapter four the author gives us some advice and chapter five demonstrates some useful examples. The books ends with a reference, summarizing the topics discussed in the first two chapters. Other than a few minor misprints and one slightly confusing group example early on I could find nothing to complain about. Any Java programmer interested in learning regular expressions will find this book extremely useful. It is hard to imagine that there could be a better book on regular expressions than this one.
|
|
|
1 of 1 people found the following review helpful:
5.0 out of 5 stars
This is not your father’s procedural regex reference., 29 Feb 2004
I've had this book a bit over a day. Yes, I've read the entire book. It is that good.As I first approached it, I was afraid of this book. It's so easy to explain regular expressions in terribly dry and technical ways. Max, the author, doesn't do that. Don't fear your painful memories of the wordy, boring, and expensive text books read during university studies. This book won't bring them back. Max has again demonstrated his excellent, clear and concise writing skills with Java Regular Expressions. This book is not some boring reference or cookbook of regular expressions, excellent ones of which can be found for free on the internet. Instead, this book provides excellent explanations detailing techniques on how to understand and create regular expressions – object-oriented techniques at that! This is not your father’s procedural regex reference. New to java.util.regex? Buy this book, not that other one.
|
|
|
Most Recent Customer Reviews
|