Last active
August 24, 2021 13:54
-
-
Save pfitzseb/1e5cb6c52b196bb556983959c1aef02b to your computer and use it in GitHub Desktop.
Julia Identifier Regex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Regex("""(?:[ | |
[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}\u2140-\u2144\u223f\u22be | |
\u22bf\u22a4\u22a5\u2202\u2205-\u2207\u220e\u220f\u2210\u2211\u221e\u221f\u222b-\u2233 | |
\u22c0-\u22c3\u25f8-\u25ff\u266f\u27d8\u27d9\u27c0\u27c1\u29b0-\u29b4\u2a00-\u2a06 | |
\u2a09-\u2a16\u2a1b\u2a1c\U1d6c1\U1d6db\U1d6fb\U1d715\U1d735\U1d74f\U1d76f\U1d789\U1d7a9 | |
\U1d7c3\u2071-\u207e\u2081-\u208e\u2220-\u2222\u299b-\u29af\u2118\u212e\u309b-\u309c | |
\U1d7ce-\U1d7e1 | |
]|[^\\P{So}\u2190-\u21FF]) | |
(?:[ | |
[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}\u2140-\u2144\u223f\u22be | |
\u22bf\u22a4\u22a5\u2202\u2205-\u2207\u220e\u220f\u2210\u2211\u221e\u221f\u222b-\u2233 | |
\u22c0-\u22c3\u25f8-\u25ff\u266f\u27d8\u27d9\u27c0\u27c1\u29b0-\u29b4\u2a00-\u2a06 | |
\u2a09-\u2a16\u2a1b\u2a1c\U1d6c1\U1d6db\U1d6fb\U1d715\U1d735\U1d74f\U1d76f\U1d789\U1d7a9 | |
\U1d7c3\u2071-\u207e\u2081-\u208e\u2220-\u2222\u299b-\u29af\u2118\u212e\u309b-\u309c | |
\U1d7ce-\U1d7e1 | |
]|[^\\P{Mn}\u0001-\ua1]|[^\\P{Mc}\u0001-\ua1]|[^\\P{Nd}\u0001-\ua1]|[^\\P{Pc}\u0001-\ua1]|[^\\P{Sk}\u0001-\ua1]|[^\\P{Me}\u0001-\ua1]|[^\\P{No}\u0001-\ua1]|[\u2032-\u2037\u2057]|[^\\P{So}\u2190-\u21FF])* | |
""", "x") | |
r"(?:[ | |
[:alpha:]_\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}\p{Sc}⅀-⅄∿⊾ | |
⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳ | |
⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆ | |
⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩 | |
𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜ | |
𝟎-𝟡 | |
]|[^\P{So}←-⇿]) | |
(?:[ | |
[:word:]_!\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}\p{Sc}⅀-⅄∿⊾ | |
⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳ | |
⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆ | |
⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩 | |
𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜ | |
𝟎-𝟡 | |
]|[^\P{Mn}\u0001-¡]|[^\P{Mc}\u0001-¡]|[^\P{Nd}\u0001-¡]|[^\P{Pc}\u0001-¡]|[^\P{Sk}\u0001-¡]|[^\P{Me}\u0001-¡]|[^\P{No}\u0001-¡]|[′-‷⁗]|[^\P{So}←-⇿])* | |
"x | |
Regex("""(?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}\u2140-\u2144\u223f\u22be\u22bf\u22a4\u22a5\u2202\u2205-\u2207\u220e\u220f\u2210\u2211\u221e\u221f\u222b-\u2233\u22c0-\u22c3\u25f8-\u25ff\u266f\u27d8\u27d9\u27c0\u27c1\u29b0-\u29b4\u2a00-\u2a06\u2a09-\u2a16\u2a1b\u2a1c\U1d6c1\U1d6db\U1d6fb\U1d715\U1d735\U1d74f\U1d76f\U1d789\U1d7a9\U1d7c3\u2071-\u207e\u2081-\u208e\u2220-\u2222\u299b-\u29af\u2118\u212e\u309b-\u309c\U1d7ce-\U1d7e1]|[^\\P{So}\u2190-\u21FF])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}\u2140-\u2144\u223f\u22be\u22bf\u22a4\u22a5\u2202\u2205-\u2207\u220e\u220f\u2210\u2211\u221e\u221f\u222b-\u2233\u22c0-\u22c3\u25f8-\u25ff\u266f\u27d8\u27d9\u27c0\u27c1\u29b0-\u29b4\u2a00-\u2a06\u2a09-\u2a16\u2a1b\u2a1c\U1d6c1\U1d6db\U1d6fb\U1d715\U1d735\U1d74f\U1d76f\U1d789\U1d7a9\U1d7c3\u2071-\u207e\u2081-\u208e\u2220-\u2222\u299b-\u29af\u2118\u212e\u309b-\u309c\U1d7ce-\U1d7e1]|[^\\P{Mn}\u0001-\ua1]|[^\\P{Mc}\u0001-\ua1]|[^\\P{Nd}\u0001-\ua1]|[^\\P{Pc}\u0001-\ua1]|[^\\P{Sk}\u0001-\ua1]|[^\\P{Me}\u0001-\ua1]|[^\\P{No}\u0001-\ua1]|[\u2032-\u2037\u2057]|[^\\P{So}\u2190-\u21FF])*""") | |
Regex("(?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*") | |
r"(?:[[:alpha:]_\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\P{So}←-⇿])(?:[[:word:]_!\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\P{Mn}\u0001-¡]|[^\P{Mc}\u0001-¡]|[^\P{Nd}\u0001-¡]|[^\P{Pc}\u0001-¡]|[^\P{Sk}\u0001-¡]|[^\P{Me}\u0001-¡]|[^\P{No}\u0001-¡]|[′-‷⁗]|[^\P{So}←-⇿])*" | |
# something like Base.isoperator | |
r"(~|=>|←|→|↔|↚|↛|↞|↠|↢|↣|↦|↤|↮|⇎|⇍|⇏|⇐|⇒|⇔|⇴|⇶|⇷|⇸|⇹|⇺|⇻|⇼|⇽|⇾|⇿|⟵|⟶|⟷|⟹|⟺|⟻|⟼|⟽|⟾|⟿|⤀|⤁|⤂|⤃|⤄|⤅|⤆|⤇|⤌|⤍|⤎|⤏|⤐|⤑|⤔|⤕|⤖|⤗|⤘|⤝|⤞|⤟|⤠|⥄|⥅|⥆|⥇|⥈|⥊|⥋|⥎|⥐|⥒|⥓|⥖|⥗|⥚|⥛|⥞|⥟|⥢|⥤|⥦|⥧|⥨|⥩|⥪|⥫|⥬|⥭|⥰|⧴|⬱|⬰|⬲|⬳|⬴|⬵|⬶|⬷|⬸|⬹|⬺|⬻|⬼|⬽|⬾|⬿|⭀|⭁|⭂|⭃|⭄|⭇|⭈|⭉|⭊|⭋|⭌|←|→|⇜|⇝|↜|↝|↩|↪|↫|↬|↼|↽|⇀|⇁|⇄|⇆|⇇|⇉|⇋|⇌|⇚|⇛|⇠|⇢|↷|↶|↺|↻|-->|<--|<-->|>|<|>=|≥|<=|≤|==|===|≡|!=|≠|!==|≢|∈|∉|∋|∌|⊆|⊈|⊂|⊄|⊊|∝|∊|∍|∥|∦|∷|∺|∻|∽|∾|≁|≃|≂|≄|≅|≆|≇|≈|≉|≊|≋|≌|≍|≎|≐|≑|≒|≓|≖|≗|≘|≙|≚|≛|≜|≝|≞|≟|≣|≦|≧|≨|≩|≪|≫|≬|≭|≮|≯|≰|≱|≲|≳|≴|≵|≶|≷|≸|≹|≺|≻|≼|≽|≾|≿|⊀|⊁|⊃|⊅|⊇|⊉|⊋|⊏|⊐|⊑|⊒|⊜|⊩|⊬|⊮|⊰|⊱|⊲|⊳|⊴|⊵|⊶|⊷|⋍|⋐|⋑|⋕|⋖|⋗|⋘|⋙|⋚|⋛|⋜|⋝||⋞|⋟|⋠|⋡|⋢|⋣|⋤|⋥|⋦|⋧|⋨|⋩|⋪|⋫|⋬|⋭|⋲|⋳|⋴|⋵|⋶|⋷|⋸|⋹|⋺|⋻|⋼|⋽|⋾|⋿|⟈|⟉|⟒|⦷|⧀|⧁|⧡|⧣|⧤|⧥|⩦|⩧|⩪|⩫|⩬|⩭|⩮|⩯|⩰|⩱|⩲|⩳|⩵|⩶|⩷|⩸|⩹|⩺|⩻|⩼|⩽|⩾|⩿|⪀|⪁|⪂|⪃|⪄|⪅|⪆|⪇|⪈|⪉|⪊|⪋|⪌|⪍|⪎|⪏|⪐|⪑|⪒|⪓|⪔|⪕|⪖|⪗|⪘|⪙|⪚|⪛|⪜|⪝|⪞|⪟|⪠|⪡|⪢|⪣|⪤|⪥|⪦|⪧|⪨|⪩|⪪|⪫|⪬|⪭|⪮|⪯|⪰|⪱|⪲|⪳|⪴|⪵|⪶|⪷|⪸|⪹|⪺|⪻|⪼|⪽|⪾|⪿|⫀|⫁|⫂|⫃|⫄|⫅|⫆|⫇|⫈|⫉|⫊|⫋|⫌|⫍|⫎|⫏|⫐|⫑|⫒|⫓|⫔|⫕|⫖|⫗|⫘|⫙|⫷|⫸|⫹|⫺|⊢|⊣|⟂|⫪|⫫|<:|>:|<\||\|>|..|…|⁝|⋮|⋱|⋰|⋯|$|\+|-|−|¦|⊕|⊖|⊞|⊟|\+\+|∪|∨|⊔|±|∓|∔|∸|≏|⊎|⊻|⊽|⋎|⋓|⧺|⧻|⨈|⨢|⨣|⨤|⨥|⨦|⨧|⨨|⨩|⨪|⨫|⨬|⨭|⨮|⨹|⨺|⩁|⩂|⩅|⩊|⩌|⩏|⩐|⩒|⩔|⩖|⩗|⩛|⩝|⩡|⩢|⩣|\*|/|⌿|÷|%|&|·|·|⋅|∘|×|\\\\|∩|∧|⊗|⊘|⊙|⊚|⊛|⊠|⊡|⊓|∗|∙|∤|⅋|≀|⊼|⋄|⋆|⋇|⋉|⋊|⋋|⋌|⋏|⋒|⟑|⦸|⦼|⦾|⦿|⧶|⧷|⨇|⨰|⨱|⨲|⨳|⨴|⨵|⨶|⨷|⨸|⨻|⨼|⨽|⩀|⩃|⩄|⩋|⩍|⩎|⩑|⩓|⩕|⩘|⩚|⩜|⩞|⩟|⩠|⫛|⊍|▷|⨝|⟕|⟖|⟗|⨟|//|<<|>>|>>>|^|↑|↓|⇵|⟰|⟱|⤈|⤉|⤊|⤋|⤒|⤓|⥉|⥌|⥍|⥏|⥑|⥔|⥕|⥘|⥙|⥜|⥝|⥠|⥡|⥣|⥥|⥮|⥯|↑|↓)[ⁱ-⁾₁-₎⦛-⦯゛-゜]*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment