Staying Regular: Using Regular Expressions to Search Text

Unix administrators like to keep themselves "regular," at least according to an old programming joke. Don't worry; this section is not about dietary fiber but about a type of pattern matching known as regular expressions, or regex. For a long time, Unix power users have worked with commands or programs that are based on regular expressions, such as grep, perl, sed, and awk. Because this is such a powerful way of searching and manipulating Strings, Java 1.4 added the java.util.regex package to the core API. Of course, Java is platform-independent, and these regular expressions ...

Get Wicked Cool Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.