In this chapter, we discussed composite and inner character classes. We found out how we can use the union, intersection, and subtraction operations to combine simple character classes and make a completely different character class to suit our requirements. You learned some good usage patterns of composite character classes for solving tricky problems. Note how we could avoid more complex lookahead and lookbehind assertions by using the union and intersection of character classes.

In the next chapter, we will discuss the pitfalls of some poorly written regular expressions, and you will learn ways to avoid them. You will also learn some important optimizing tips and performance improvement methods for writing complex regular expressions. ...

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.