O'Reilly logo

Java 9 Regular Expressions by Anubhava Srivastava

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Regular Expression Pitfalls, Optimization, and Performance Improvements

Regular expressions, if not written well may perform poorly. They may run slowly, and when they are executed frequently in some code, they may be the source of high CPU utilization. To avoid these problems, regular expressions have to be crafted carefully, understanding the possible pitfalls, and they also have to be tested thoroughly. We will be covering the following topics in this chapter:

  • Common pitfalls and ways to avoid them while writing regular expressions
  • How to test your regex functionality and performance
  • Optimization and performance enhancing tips
  • Catastrophic backtracking and how to avoid it

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required