Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Latest commit

 

History

History
23 lines (16 loc) · 720 Bytes

optimized-character-class.md

File metadata and controls

23 lines (16 loc) · 720 Bytes

optimized-character-class 🔧

Disallows unnecessary elements in character classes.

configuration in plugin:clean-regex/recommended: "warn"

Source file
Test file

Description

This will will provide fixes to remove unnecessary characters, character ranges, and character sets from character classes.

Examples

/[a-zf]/   -> /[a-z]/
/[a-z\w]/  -> /[\w]/
/[\s\r\n]/ -> /[\s]/
/[a-zH]/i  -> /[a-z]/