Skip to content

Files

Latest commit

 

History

History
26 lines (18 loc) · 383 Bytes

no-empty-capturing-group.md

File metadata and controls

26 lines (18 loc) · 383 Bytes

Pattern: Empty capturing group

Issue: -

Description

This rule reports capturing group that captures assertions.

Examples

/* eslint regexp/no-empty-capturing-group: "error" */

/* ✓ GOOD */
var foo = /(a)/;
var foo = /a(?:\b)/;
var foo = /a(?:$)/;
var foo = /(?:^)a/;
var foo = /(?:^|b)a/;

/* ✗ BAD */
var foo = /a(\b)/;
var foo = /a($)/;
var foo = /(^)a/;