Prefer simple constant quantifiers over the range form.
configuration in plugin:clean-regex/recommended
: "warn"
This rule enforces the usage from simple constant quantifiers (e.g. a{2}
)
instead of their more verbose range form (e.g. a{2,2}
).
Examples of valid code for this rule:
/a+b*c?/
/a{2,}b{2,6}c{2}/
Examples of invalid code for this rule:
/a{2,2}/
/a{100,100}?/