/
regex_feature.test
46 lines (40 loc) · 1.2 KB
/
regex_feature.test
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
/foo bar/;
/foo/gimyus,
/[\[\]]{2,4}(?:foo)*/;
/foo"test"bar/;
/foo\//;
/[]/;
/[\]/]/;
1 / 4 + "/, not a regex";
/ '1' '2' '3' '4' '5' /
[/foo/]
let a = /regex/m // comment
let b = condition ? /regex/ : /another one/
----------------------------------------------------
[
["regex", "/foo bar/"], ["punctuation", ";"],
["regex", "/foo/gimyus"], ["punctuation", ","],
["regex", "/[\\[\\]]{2,4}(?:foo)*/"], ["punctuation", ";"],
["regex", "/foo\"test\"bar/"], ["punctuation", ";"],
["regex", "/foo\\//"], ["punctuation", ";"],
["regex", "/[]/"], ["punctuation", ";"],
["regex", "/[\\]/]/"], ["punctuation", ";"],
["number", "1"], ["operator", "/"], ["number", "4"], ["operator", "+"], ["string", "\"/, not a regex\""], ["punctuation", ";"],
["regex", "/ '1' '2' '3' '4' '5' /"],
["punctuation", "["], ["regex", "/foo/"], ["punctuation", "]"],
["keyword", "let"],
" a ",
["operator", "="],
["regex", "/regex/m"],
["comment", "// comment"],
["keyword", "let"],
" b ",
["operator", "="],
" condition ",
["operator", "?"],
["regex", "/regex/"],
["operator", ":"],
["regex", "/another one/"]
]
----------------------------------------------------
Checks for regex.