Files
Bas Leijdekkers c50a102e50 update RegExp inspection descriptions with examples
GitOrigin-RevId: 1daa0f68ede1036d134127cdacd0b61e5d438ca8
2021-06-06 13:43:39 +00:00

19 lines
702 B
HTML

<html>
<body>
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. <code>(?:xxx)</code> instead of <code>(xxx)</code>.
<p><b>Example:</b></p>
<pre><code>
(\d\d\d\d)\1
</code></pre>
<p>A better regex pattern could look like this:</p>
<pre><code>
(?&lt;quad>\d\d\d\d)\k&lt;quad>
</code></pre>
<!-- tooltip end -->
<p><small>New in 2017.2</small>
</body>
</html>