-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathregex_operator.json
More file actions
60 lines (60 loc) · 1.83 KB
/
regex_operator.json
File metadata and controls
60 lines (60 loc) · 1.83 KB
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
{
"tests": [
{
"name": "regex literal, match",
"selector": "$.some[?(@.thing =~ /fo[a-z]/)]",
"document": { "some": [{ "thing": "foo" }] },
"result": [{ "thing": "foo" }],
"result_paths": ["$['some'][0]"],
"tags": ["extra"]
},
{
"name": "regex literal, no match",
"selector": "$.some[?(@.thing =~ /fo[a-z]/)]",
"document": { "some": [{ "thing": "foO" }] },
"result": [],
"result_paths": [],
"tags": ["extra"]
},
{
"name": "regex literal, case insensitive match",
"selector": "$.some[?(@.thing =~ /fo[a-z]/i)]",
"document": { "some": [{ "thing": "foO" }] },
"result": [{ "thing": "foO" }],
"result_paths": ["$['some'][0]"],
"tags": ["extra"]
},
{
"name": "regex literal, escaped backslash",
"selector": "$.some[?(@.thing =~ /fo\\\\[a-z]/)]",
"document": { "some": [{ "thing": "fo\\b" }] },
"result": [{ "thing": "fo\\b" }],
"result_paths": ["$['some'][0]"],
"tags": ["extra"]
},
{
"name": "regex literal, escaped slash",
"selector": "$.some[?(@.thing =~ /fo\\/[a-z]/)]",
"document": { "some": [{ "thing": "fo/b" }] },
"result": [{ "thing": "fo/b" }],
"result_paths": ["$['some'][0]"],
"tags": ["extra"]
},
{
"name": "regex literal, escaped asterisk",
"selector": "$.some[?(@.thing =~ /fo\\*[a-z]/)]",
"document": { "some": [{ "thing": "fo*b" }] },
"result": [{ "thing": "fo*b" }],
"result_paths": ["$['some'][0]"],
"tags": ["extra"]
},
{
"name": "regex literal, escaped dot",
"selector": "$.some[?(@.thing =~ /fo\\.[a-z]/)]",
"document": { "some": [{ "thing": "fo.b" }] },
"result": [{ "thing": "fo.b" }],
"result_paths": ["$['some'][0]"],
"tags": ["extra"]
}
]
}