Reports assertions in regular expressions that always reject.
✅ This rule is included in the ts logical presets.
Reports assertions in regular expressions that always reject.
These patterns will never match because the assertion contradicts its surrounding context.
A word boundary (\b) always rejects when placed between two word characters or two non-word characters.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>AE<\bsp ansty="le--0:#5CA7E4;--1:#3A68">8\bsp>1<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meec-li">AEconsB0patterAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>AE<\bsp ansty="le--0:#5CA7E4;--1:#3A68">8\bsp>1<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp>3;d><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fa spans="tyle--0:#C792EA;--1:#88">4488Fa>6<88F- spans="tyle--0:#D9F5DD;--1:#11">188F-><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>44AEco61B0patt446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88F- spans="tyle--0:#C792EA;--1:#88">4488F->6<88Fa spans="tyle--0:#D9F5DD;--1:#11">188Fa><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>
A negated word boundary (\B) always rejects when there is a word/non-word transition.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>AE<\Bsp ansty="le--0:#5CA7E4;--1:#3A68">8\Bsp>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:#5CA7E4;--1:#3A">6111/><88Fa spans="tyle--0:#C792EA;--1:#88">4488Fa>6<88Fa spans="tyle--0:#D9F5DD;--1:#11">188Fa><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>
Start (^) and end ($) anchors always reject when not at pattern boundaries (without the multiline flag).
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>A81<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp><3;d ivclassNa="meec-li">AEconsB0patterAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">8 =sp>1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">81/sp>A81<1/sp ansty="le--0:#D6DEEB;--1:#403F">51/sp>3;d><3;d ivclassNa="meco">;d>/;d>3;d> 44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#C792EA;--1:#88">4111/><4AE^ spans="tyle--0:#5CA7E4;--1:#3A">684AE^><8Fab spans="tyle--0:#D9F5DD;--1:#11">18Fab><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>44AEco61B0patt446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">68111/><8Fab spans="tyle--0:#C792EA;--1:#88">48Fab><4AE$ spans="tyle--0:#D9F5DD;--1:#11">14AE$><111/ spans="tyle--0:#D6DEEB;--1:#40">3111/>44AEco61B0patt446<88F spans="tyle--0:#D9F5DD;--1:#11">188F ><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fa spans="tyle--0:#C792EA;--1:#88">488Fa><4AE^ spans="tyle--0:#5CA7E4;--1:#3A">64AE^><88Fb spans="tyle--0:#D9F5DD;--1:#11">188Fb><111/ spans="tyle--0:#5CA7E4;--1:#3A">6111/><88Fm spans="tyle--0:#D6DEEB;--1:#40">388Fm>
The rule also checks regex patterns in RegExp constructor calls.
AEconsB0patteAE <= sp ansty="le--0:#7FDBCA;--1:#096E">72n= sp>AB0RegE5<3(sp ansty="le--0:#D9F5DD;--1:#1111">13(sp><1"sp ansty="le--0:#ECC48D;--1:#984E">41"sp>82<\\sp ansty="le--0:#ECC48D;--1:#984E">4D\\sp>1<1"sp ansty="le--0:#D6DEEB;--1:#403F">531"sp><);d ivclassNa="meco"><);d>);d>);d> 44AEco61B0pat44A6E7<2new spans="tyle--0:#C792EA;--1:#88">42new><4AE spans="tyle--0:#82AAFF;--1:#3B">61B0Re4AE >31<111" spans="tyle--0:#ECC48D;--1:#98">4111">09<82\\ spans="tyle--0:#ECC48D;--1:#98">4E82\\><4Db- spans="tyle--0:#D9F5DD;--1:#11">14Db-><111" spans="tyle--0:#D6DEEB;--1:#40">3F111"><53) ;divclass="Name"><-")>-")>53)>
This rule is not configurable.
If you are working with dynamically constructed regex patterns where the simplified detection may cause false positives, you may disable this rule.