Character classes

We briefly looked at character classes in the first chapter. Character classes (or character sets) let us match one out of the many characters defined inside a class. Character classes are enclosed inside a square bracket. The order of the characters inside a character class does not matter.

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.