Reports regex patterns that can be simplified by using the i (ignore case) flag.
✅ This rule is included in the ts logical and logicalStrict presets.
When a character class contains both upper and lower case versions of the same letters, the pattern can be simplified by using the i (ignore case) flag.
This makes the regex shorter and clearer by eliminating redundant character class entries.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B0[a1/sp>1<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d>AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B0[a-zA-1/sp>1<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d>AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#82AAFF;--1:#3B61">B0[aAbBc1/sp>1<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#82AAFF;--1:#3B">61B111/><0[a] spans="tyle--0:#D9F5DD;--1:#11">10[a]><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fi spans="tyle--0:#D6DEEB;--1:#40">388Fi><]/i>]/i><;di vdivclass="Nameexpressive-">44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#82AAFF;--1:#3B">61B0[111/>1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fi spans="tyle--0:#D6DEEB;--1:#40">388Fi><]/i>]/i>;di><;di vdivclass="Nameexpressive-">44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#82AAFF;--1:#3B">61B0[111/>1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fi spans="tyle--0:#D6DEEB;--1:#40">388Fi><]/i>]/i>;di><;di vdivclass="Nameexpressive-">6376// Only lowercase letters - no redund44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#82AAFF;--1:#3B">61B0[111/>1<111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>;di><;di vdivclass="Nameexpressive-">6376// Only uppercase letters - no redund44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#82AAFF;--1:#3B">61B0[111/>1<111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>;di><;di vdivclass="Nameexpressive-">6376// Already using the i 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#82AAFF;--1:#3B">61B0[111/>1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fi spans="tyle--0:#D6DEEB;--1:#40">388Fi><]/i>]/i>;di>
This rule is not configurable.
If you need explicit control over case matching in your regex patterns, or if your codebase intentionally avoids the i flag for performance or compatibility reasons, you might prefer to disable this rule.
Some legacy JavaScript environments may have inconsistent behavior with the i flag for non-ASCII characters.