Avoid unnecessary grouping

Avoiding unnecessary captured groups in your regex. If grouping is required in your regex, then use non-capturing groups to save the overall memory footprint of the regex pattern while executing.

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.