< Free Open Study > |
Chapter 8. JavaJava didn't come with a regex package until Java 1.4, so early programmers had to do without regular expressions. Over time, many programmers independently developed Java regex packages of varying degrees of quality, functionality, and complexity. With the early-2002 release of Java 1.4, Sun entered the fray with their java.util.regex package. In preparing this chapter, I looked at Sun's package, and a few others (detailed starting in see Section 8.2.2). So which one is best? As you'll soon see, there can be many ways to judge that. In This Chapter Before looking at what's in this chapter, it's important to mention what's not in this chapter. In short, this chapter doesn't restate everything from Chapters 1 through 6. I understand that some readers interested only in Java may be inclined to start their reading with this chapter, and I want to encourage them not to miss the benefits of the preface and the earlier chapters: Chapters 1, 2, and 3 introduce basic concepts, features, and techniques involved with regular expressions, while Chapters 4, 5, and 6 offer important keys to regex understanding that directly apply to every Java regex package that I know of. As for this chapter, it has several distinct parts. The first part, consisting of "Judging a Regex Package" and "Object Models," looks abstractly at some concepts that help you to understand an unfamiliar package more quickly, and to help judge its suitability for your needs. The second part, "Packages, Packages, Packages," moves away from the abstract to say a few words about the specific packages I looked at while researching this book. Finally, we get to the real fun, as the third part talks in specifics about two of the packages, Sun's java.util.regex and Jakarta's ORO package. |
< Free Open Study > |