RunDevelopment/eslint-plugin-clean-regex

Consistent match all character class

RunDevelopment opened this issue · 0 comments

There are multiple ways to express a character class which accepts all characters but you should choose one and stick with it to make your regexes easier to understand.

Examples:

/[\s\S]/, /[\d\D]/, /[\w\W]/, /[^]/

Notes:
If present, we could even take advantage of the s flag.

This should also detect alternations which are equal to the set of all characters. Examples:

/(?:\s|\S)/, /\s|\S/, /(?:.|\s)/, /.|\D/