O'Reilly logo

Java™ Phrasebook by Timothy Fisher

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Regular Expressions in Java

The Java classes you will use to perform regular expression operations are contained in the java.util.regex package. The classes are the Matcher and the Pattern classes. These classes allow you to both find and match character sequences against regular expression patterns. You might be wondering what the difference is between finding and matching. The find operation allows you to find matches in a string, and the match operation requires the entire string to be an exact match of the regular expression. Tasks for which you might have used the StringTokenizer class in the past are usually good candidates for exploring the possibility of simplifying your programming with regular expressions.

Note

If you are not able ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required