Skip to content

Commit 49fa349

Browse files
author
MattDMo
committed
Identify individual constant.character.character-class members
1 parent b1575a4 commit 49fa349

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

Regular Expressions (PythonImproved).YAML-tmLanguage

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ patterns:
6161
- include: $self
6262

6363
- name: meta.group.regex
64-
begin: (\()((\?P<)([a-z]\w*)(>)|(\?:))?
64+
begin: (\()((\?P<)([A-Za-z]\w*)(>)|(\?:))?
6565
beginCaptures:
6666
'1': {name: punctuation.definition.group.regex}
6767
'3': {name: punctuation.definition.group.capture.regex}
@@ -79,8 +79,23 @@ patterns:
7979
repository:
8080
character-class:
8181
patterns:
82-
- name: constant.character.character-class.regex
83-
match: \\[wWsSdDhH]|\.
82+
- match: |-
83+
(?x)\\
84+
(
85+
(w) |
86+
(W) |
87+
(s) |
88+
(S) |
89+
(d) |
90+
(D)
91+
)
92+
captures:
93+
'2': {name: constant.character.character-class.word.regex}
94+
'3': {name: constant.character.character-class.non-word.regex}
95+
'4': {name: constant.character.character-class.whitespace.regex}
96+
'5': {name: constant.character.character-class.non-whitespace.regex}
97+
'6': {name: constant.character.character-class.digit.regex}
98+
'7': {name: constant.character.character-class.non-digit.regex}
8499
- name: constant.character.escape.backslash.regex
85100
match: \\.
86101
- name: constant.other.character-class.set.regex

0 commit comments

Comments
 (0)