In the final chapter of this book, we discussed some common mistakes people make while writing regular expressions. These mistakes often cause some exceptions to be thrown at runtime or cause the regular expressions to fail the match unexpectedly. Then, you learned the various ways to avoid such mistakes.

We discussed catastrophic backtracking in regular expressions and the tricks to avoid excessive backtracking. By minimizing the backtracking steps, regular expressions can become really efficient.

You learned the testing and benchmarking techniques for regular expressions. Finally, we covered many regex optimization and performance enhancing tips in detail. We hope these tips help you understand the building blocks of 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.