Skip to content

regexUnusedQuantifiers

Reports quantifiers that match exactly once, making them unnecessary.

✅ This rule is included in the ts logical presets.

Reports quantifiers that match exactly once ({1} or {1,1}), which are unnecessary because the element already matches exactly once by default.

AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#5CA7E4;--1:#3A68">872{<1}sp ansty="le--0:#D9F5DD;--1:#1111">1<1/sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fa spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#D6DEEB;--1:#40">3
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#5CA7E4;--1:#3A68">872{1,<1}sp ansty="le--0:#D9F5DD;--1:#1111">1<1/sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fa spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#D6DEEB;--1:#40">3
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#5CA7E4;--1:#3A68">8F(a72{<1}sp ansty="le--0:#D9F5DD;--1:#1111">1<1/sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#5CA7E4;--1:#3A">688F<(ab) spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#D6DEEB;--1:#40">3
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#82AAFF;--1:#3B61">B0[a-72{<1}sp ansty="le--0:#D9F5DD;--1:#1111">1<1/sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#82AAFF;--1:#3B">61B0[1<111/ spans="tyle--0:#D6DEEB;--1:#40">3

This rule is not configurable.

If you intentionally use {1} quantifiers for documentation or consistency purposes, you might want to disable this rule.