Skip to content

regexUnicodeProperties

Reports inconsistent Unicode property names in regular expressions.

✅ This rule is included in the ts stylistic presets.

Unicode properties may be expressed in several different ways. Including the fully-written out category prefix is a more verbose way that is not necessary.

This rule detects inconsistent Unicode property names in regular expressions and suggests more idiomatic forms for:

  1. Unnecessary gc= / General_Category= prefix: unicode general category properties can be used without the prefix.
  2. Long script names: short script aliases like Grek should use the full name Greek for readability.
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#F78C6C;--1:#AA09">82<\psp ansty="le--0:#5CA7E4;--1:#3A68">8F{gc=1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">85<3;d ivclassNa="meec-li">AEconsB0patterAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#F78C6C;--1:#AA09">82<\psp ansty="le--0:#5CA7E4;--1:#3A68">8F{General_Category=Lette1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">85<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#F78C6C;--1:#AA">09<82\p spans="tyle--0:#5CA7E4;--1:#3A">6881<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fu spans="tyle--0:#D6DEEB;--1:#40">344AEco61B0patt446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#F78C6C;--1:#AA">09<82\p spans="tyle--0:#5CA7E4;--1:#3A">688F{Let1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fu spans="tyle--0:#D6DEEB;--1:#40">3<}/u>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#F78C6C;--1:#AA09">82<\psp ansty="le--0:#5CA7E4;--1:#3A68">8F{sc=Gre1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">85<3;d ivclassNa="meec-li">AEconsB0patterAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#F78C6C;--1:#AA09">82<\psp ansty="le--0:#5CA7E4;--1:#3A68">8F{Script=Lat1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">85<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#F78C6C;--1:#AA">09<82\p spans="tyle--0:#5CA7E4;--1:#3A">688F{sc=Gr1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fu spans="tyle--0:#D6DEEB;--1:#40">344AEco61B0patt446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#F78C6C;--1:#AA">09<82\p spans="tyle--0:#5CA7E4;--1:#3A">688F{Script=La1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fu spans="tyle--0:#D6DEEB;--1:#40">3<}/u>
AEconsB0patteAE< =sp ansty="le--0:#5CA7E4;--1:#3A68">81<1/sp ansty="le--0:#F78C6C;--1:#AA09">82<\psp ansty="le--0:#5CA7E4;--1:#3A68">8F{scx=Cyr1<1/sp ansty="le--0:#5CA7E4;--1:#3A68">85<3;d ivclassNa="meco">
44AEco61B0pat446<88F spans="tyle--0:#D9F5DD;--1:#11">1<111/ spans="tyle--0:#F78C6C;--1:#AA">09<82\p spans="tyle--0:#5CA7E4;--1:#3A">688F{scx=Cyril1<111/ spans="tyle--0:#5CA7E4;--1:#3A">6<88Fu spans="tyle--0:#D6DEEB;--1:#40">3<}/u>
AEconsB0patteAE <= sp ansty="le--0:#7FDBCA;--1:#096E">72nAB0RegE5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#F78C6C;--1:#AA09">82<\\sp ansty="le--0:#ECC48D;--1:#984E">4Dp{gc=1<1"sp ansty="le--0:#C792EA;--1:#8844">AE<, sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">41<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<);d ivclassNa="meec-li">AEconsB0patterAE <= sp ansty="le--0:#7FDBCA;--1:#096E">72nAB0RegE5<3(sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#F78C6C;--1:#AA09">82<\\sp ansty="le--0:#ECC48D;--1:#984E">4Dp{sc=Gre1<1"sp ansty="le--0:#C792EA;--1:#8844">AE<, sp ansty="le--0:#D9F5DD;--1:#1111">1<1"sp ansty="le--0:#ECC48D;--1:#984E">41<1"sp ansty="le--0:#D6DEEB;--1:#403F">53<);d ivclassNa="meco"><);d>
44AEco61B0pat44A6E7<2new spans="tyle--0:#C792EA;--1:#88">4<4AE spans="tyle--0:#82AAFF;--1:#3B">61B0Re31<111" spans="tyle--0:#F78C6C;--1:#AA">09<82\\ spans="tyle--0:#ECC48D;--1:#98">4E4D1<111" spans="tyle--0:#C792EA;--1:#88">441<111" spans="tyle--0:#ECC48D;--1:#98">41<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Nameec-">44AEco61B0patt44A6E7<2new spans="tyle--0:#C792EA;--1:#88">4<4AE spans="tyle--0:#82AAFF;--1:#3B">61B0Re31<111" spans="tyle--0:#F78C6C;--1:#AA">09<82\\ spans="tyle--0:#ECC48D;--1:#98">4E4Dp{sc=Gr1<111" spans="tyle--0:#C792EA;--1:#88">441<111" spans="tyle--0:#ECC48D;--1:#98">41<111" spans="tyle--0:#D6DEEB;--1:#40">3F<53) ;divclass="Name">

This rule is not configurable.

If your project has a style guide that prefers explicit gc= prefixes or short script names for consistency with other documentation, you might want to disable this rule.