Skip to content

Commit 7c62f01

Browse files
committed
Fix dot and newline anchors .^$
1 parent 4b4de8f commit 7c62f01

1 file changed

Lines changed: 22 additions & 7 deletions

File tree

syntaxes/regex.tmLanguage.json

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
},
3232
"patterns": [
3333
{ "include": "#test" },
34+
{ "include": "#dot" },
35+
{ "include": "#anchor" },
3436
{ "include": "#alternation" },
3537
{ "include": "#quantifier" },
3638
{ "include": "#character-class" },
@@ -158,7 +160,7 @@
158160
{ "include": "#character-types" },
159161
{ "include": "#character-types-2" },
160162
{ "include": "#characters" },
161-
{ "include": "#anchor" },
163+
{ "include": "#escaped-anchor" },
162164
{ "include": "#subroutine" },
163165
{ "include": "#backreference" },
164166
{ "include": "#code-point" },
@@ -1623,19 +1625,27 @@
16231625
]
16241626
},
16251627
"anchor": {
1626-
"comment": "$ ^ \\A \\B \\b \\G \\K \\Y \\y \\Z \\z",
1627-
"match": "(?>[$^]|\\\\{2}[ABbGKYyZz])([+*?]|{(?>[0-9]+,?[0-9]*|,[0-9]+)})?",
1628+
"comment": "$ ^",
1629+
"match": "[$^]([+*?]|{(?>[0-9]+,?[0-9]*|,[0-9]+)})?",
16281630
"captures": {
16291631
"0": { "name": "variable.tm" },
1630-
"1": { "name": "invalid.illegal.tm markup.underline regex" }
1632+
"1": { "name": "invalid.illegal.tm regex" }
1633+
}
1634+
},
1635+
"escaped-anchor": {
1636+
"comment": "\\A \\B \\b \\G \\K \\Y \\y \\Z \\z",
1637+
"match": "\\G\\\\{2}[ABbGKYyZz]([+*?]|{(?>[0-9]+,?[0-9]*|,[0-9]+)})?",
1638+
"captures": {
1639+
"0": { "name": "variable.tm" },
1640+
"1": { "name": "invalid.illegal.tm regex" }
16311641
}
16321642
},
16331643
"alternation": {
16341644
"comment": "|",
16351645
"match": "\\|([+*?]|{(?>[0-9]+,?[0-9]*|,[0-9]+)})?",
16361646
"captures": {
16371647
"0": { "name": "keyword.control.tm" },
1638-
"1": { "name": "invalid.illegal.tm markup.underline regex" }
1648+
"1": { "name": "invalid.illegal.tm regex" }
16391649
}
16401650
},
16411651
"character-types": {
@@ -1644,15 +1654,20 @@
16441654
"name": "variable.other.enummember.tm"
16451655
},
16461656
"character-types-2": {
1647-
"comment": "\\. \\N \\O \\R \\X cannot be used in character classes",
1648-
"match": "\\.|\\\\{2}[NORX]",
1657+
"comment": "\\N \\O \\R \\X cannot be used in character classes",
1658+
"match": "\\G\\\\{2}[NORX]",
16491659
"name": "variable.other.enummember.tm"
16501660
},
16511661
"characters": {
16521662
"comment": "\\a \\e \\f \\n \\r \\t \\v",
16531663
"match": "\\G\\\\{2}[aefnrtv]",
16541664
"name": "punctuation.definition.list.begin.markdown"
16551665
},
1666+
"dot": {
1667+
"comment": "\\. cannot be used in character classes",
1668+
"match": "\\.",
1669+
"name": "variable.other.enummember.tm"
1670+
},
16561671
"character-literal": {
16571672
"comment": "Match anything left over and all non-meta characters",
16581673
"match": ".[^\\x00-\\x1F\\x7F \"#$^.+*?|\\[{()\\\\]*",

0 commit comments

Comments
 (0)