DataGrip
 
Get DataGrip
You are viewing the documentation for an earlier version of DataGrip.

Code Inspection: Anonymous capturing group or numeric back reference

Last modified: 13 May 2022

Reports anonymous capturing groups and numeric back references in a RegExp. These are only reported when the RegExp dialect supports named group and named group references. Named groups and named back references improve code readability and are recommended to use instead. When a capture is not needed, matching can be more performant and use less memory by using a non-capturing group, i.e. (?:xxx) instead of (xxx).

Example:

A better regex pattern could look like this:

New in 2017.2