Creating regular expressions
You can begin learning regular expressions with a subset of the possible constructs. A complete list of constructs for building regular expressions can be found in the JDK documentation for the Pattern class for package java.util.regex.
The power of regular expressions begins to appear when you are defining character classes. Here are some typical ways to create character classes, and some predefined classes:
What’s shown here is only a sample; you’ll want to bookmark the JDK documentation page for java.util.regex.Pattern so you can easily access all the possible regular expression patterns.