Unnamed repository; edit this file 'description' to name the repository.
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
; upstream: https://github.com/tree-sitter/tree-sitter-regex/blob/b2ac15e27fce703d2f37a79ccd94a5c0cbe9720b/queries/highlights.scm

[
  "("
  ")"
  "(?"
  "(?:"
  "(?<"
  "(?P<"
  "(?P="
  ">"
  "["
  "]"
  "[:"
  ":]"
  "{"
  "}"
] @punctuation.bracket

; `<=`/`<!` lookbehind are now `<` + `=`/`!` (lookahead and lookbehind share
; the unified lookaround_assertion); the bare `<` is left unhighlighted.
[
  "*"
  "+"
  "|"
  "="
  "!"
  "?"
] @operator

[
  (identity_escape)
  (control_letter_escape)
  (character_class_escape)
  (control_escape)
  (start_assertion)
  (end_assertion)
  (boundary_assertion)
  (non_boundary_assertion)
] @constant.character.escape

(group_name) @label

(count_quantifier
  [
    (decimal_digits) @constant.numeric
    "," @punctuation.delimiter
  ])

; Inline flags: `(?i)` / `(?i-s:…)`.
(inline_flags_group
  "-"? @operator
  ":"? @punctuation.delimiter)
(flags) @constant.character

(character_class
  [
    "^" @operator
    (class_range "-" @operator)
  ])

; POSIX class name (`alpha` in `[[:alpha:]]`) alongside literal class chars.
[
  (class_character)
  (posix_class_name)
] @constant.character