This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 237
/
regular expressions (javascript).cson
123 lines (123 loc) · 3.51 KB
/
regular expressions (javascript).cson
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
'scopeName': 'source.js.regexp'
'patterns': [
{
'include': '#regexp'
}
]
'repository':
'regex-character-class':
'patterns': [
{
'match': '\\\\[wWsSdDtrnvf]|\\.'
'name': 'constant.character.character-class.regexp'
}
{
'match': '\\\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})'
'name': 'constant.character.numeric.regexp'
}
{
'match': '\\\\c[A-Z]'
'name': 'constant.character.control.regexp'
}
{
'match': '\\\\.'
'name': 'constant.character.escape.backslash.regexp'
}
]
'regexp':
'patterns': [
{
'match': '\\\\[bB]|\\^|\\$'
'name': 'keyword.control.anchor.regexp'
}
{
'match': '\\\\[1-9]\\d*|\\\\k<[a-zA-Z_$][\\w$]*>'
'name': 'keyword.other.back-reference.regexp'
}
{
'match': '[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??'
'name': 'keyword.operator.quantifier.regexp'
}
{
'match': '\\|'
'name': 'keyword.operator.or.regexp'
}
{
'begin': '(\\()(?:(\\?=)|(\\?!)|(\\?<=)|(\\?<!))'
'beginCaptures':
'1':
'name': 'punctuation.definition.group.regexp'
'2':
'name': 'meta.assertion.look-ahead.regexp'
'3':
'name': 'meta.assertion.negative-look-ahead.regexp'
'4':
'name': 'meta.assertion.look-behind.regexp'
'5':
'name': 'meta.assertion.negative-look-behind.regexp'
'end': '(\\))'
'endCaptures':
'1':
'name': 'punctuation.definition.group.regexp'
'name': 'meta.group.assertion.regexp'
'patterns': [
{
'include': '#regexp'
}
]
}
{
'begin': '\\(((\\?:)|(\\?<[a-zA-Z_$][\\w$]*>))?'
'beginCaptures':
'0':
'name': 'punctuation.definition.group.regexp'
'end': '\\)'
'endCaptures':
'0':
'name': 'punctuation.definition.group.regexp'
'name': 'meta.group.regexp'
'patterns': [
{
'include': '#regexp'
}
]
}
{
'begin': '(\\[)(\\^)?'
'beginCaptures':
'1':
'name': 'punctuation.definition.character-class.regexp'
'2':
'name': 'keyword.operator.negation.regexp'
'end': '(\\])'
'endCaptures':
'1':
'name': 'punctuation.definition.character-class.regexp'
'name': 'constant.other.character-class.set.regexp'
'patterns': [
{
'captures':
'1':
'name': 'constant.character.numeric.regexp'
'2':
'name': 'constant.character.control.regexp'
'3':
'name': 'constant.character.escape.backslash.regexp'
'4':
'name': 'constant.character.numeric.regexp'
'5':
'name': 'constant.character.control.regexp'
'6':
'name': 'constant.character.escape.backslash.regexp'
'match': '(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))'
'name': 'constant.other.character-class.range.regexp'
}
{
'include': '#regex-character-class'
}
]
}
{
'include': '#regex-character-class'
}
]