This is maybe the first book from Apress that I DO not really like.
Even a brief look around the pages reveals that the author must have been either short of material, or there was a narrow deadline to keep.
Maybe both of them? Because something of a world record in spaces and abundant code must have been hit here. For example, the print out function being identical all the time, is being repeated at the end of every example.
Furthermore, because it's Java this is about, and because the target group is not novices, in most cases 5-10 lines of code would be sufficient. Instead 1-2 pages are used for every single code sample. Even worse is that some of the introducing examples import abundant code. For example you can find this
Note that the imported-by-defaultimport java.util.regex.*;
java.lang.stringis enough to compile and run the actual sample! Can seem to be trivial, but is still confusing when learning a new Java concept.
An other known trick to increase the number of pages is to copy-and-paste a language API, and pretend it to be a chapter of its own. That trick is tried here at least half ways. The
java.util.regexAPI is inserted after a very long introductory chapter. However, some useful explanations for that package are included, not to be found found in the original Javadoc.
Still, there are glimpses of light in the book. There are accurate and detailed step by step explanations following all regex syntax. And the pedagogic approach to advance from very simple to finally advanced examples is a good one. Maybe many of the problems are not about the content itself? One rather gets the feeling of a movie uncut by the director, or why not a manuscript released while still being a draft.
The topic at hand, the excellent support for regular expressions from Java 1.4 is appealing indeed. An alternative (and cheap) way of learning regular expressions is to use the excellent, free tutorials onhttp://www.regularexpressions.info/. If you want a book, Mastering Regular Expressions from O'Reilly is the Bible. Now in its third edition (2006) and expanded to include special chapters for Perl, NET, Java and more.
At the best Java Regular Expressions is a complement when learning regular expressions, but not more.