Understanding the Union, Intersection, and Subtraction of Character Classes

Some regular expression engines allow composite character classes, or character classes inside other character classes. The Java regular expression engine also supports many of these features, and we will discuss these features in this chapter.

We will cover the following topics in this chapter:

  • The union of character classes
  • The intersection of character classes
  • The subtraction of character classes
  • The advantages of using composite character classes

Get Java 9 Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.