Skip to content

Files

Latest commit

 

History

History
25 lines (13 loc) · 382 Bytes

optimize-regex.md

File metadata and controls

25 lines (13 loc) · 382 Bytes

Pattern: Unoptimized regex

Issue: -

Description

This rule enforces an idiomatic and sometimes clearer usage of regexes.

Examples of incorrect code for this rule:

const re = /[a-zA-Z_0-9][A-Z_\da-z]*\e{1,}/

Examples of correct code for this rule:

const re = /\w+e+/

The two regexes have the exact same functionality.