-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathregex-bytes.sst
153 lines (93 loc) · 6.48 KB
/
regex-bytes.sst
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
(define r-a (~make-bytevector-regex "^(a+)(.*)$")) => !ignore
(define r-b (~make-bytevector-regex "(a+)(?:(b+)|(c+))?")) => !ignore
(~bytevector-regex? r-a) => #t
(~string-regex? r-a) => #f
(bytevector? r-a) => #f
(procedure? r-a) => #f
(~bytevector-regex-match? r-a #u8"a") => #t
(~bytevector-regex-match? r-a #u8"aa") => #t
(~bytevector-regex-match? r-a #u8"aaa") => #t
(~bytevector-regex-match? r-a #u8"ab") => #t
(~bytevector-regex-match? r-a #u8"aabc") => #t
(~bytevector-regex-match? r-a #u8"aaabcd") => #t
(~bytevector-regex-match? r-a #u8"") => #f
(~bytevector-regex-match? r-a #u8"x") => #f
(~bytevector-regex-match? r-a #u8"xa") => #f
(~bytevector-regex-match r-a #u8"a") => #u8"a"
(~bytevector-regex-match r-a #u8"ab") => #u8"ab"
(~bytevector-regex-match r-a #u8"") => #f
(~bytevector-regex-match-all r-a #u8"a") => '(#u8"a")
(~bytevector-regex-match-all r-a #u8"ab") => '(#u8"ab")
(~bytevector-regex-match-all r-a #u8"") => #f
(~bytevector-regex-match-all->vector r-a #u8"a") => #(#u8"a")
(~bytevector-regex-match-all->vector r-a #u8"ab") => #(#u8"ab")
(~bytevector-regex-match-all->vector r-a #u8"") => #f
(~bytevector-regex-match-position r-a #u8"a") => '(0 . 1)
(~bytevector-regex-match-position r-a #u8"ab") => '(0 . 2)
(~bytevector-regex-match-position r-a #u8"") => #f
(~bytevector-regex-match-position-all r-a #u8"a") => '((0 . 1))
(~bytevector-regex-match-position-all r-a #u8"ab") => '((0 . 2))
(~bytevector-regex-match-position-all r-a #u8"") => #f
(~bytevector-regex-match-position-all->vector r-a #u8"a") => #((0 . 1))
(~bytevector-regex-match-position-all->vector r-a #u8"ab") => #((0 . 2))
(~bytevector-regex-match-position-all->vector r-a #u8"") => #f
(~bytevector-regex-match-captures r-a #u8"a") => '(#u8"a" #u8"a" #u8"")
(~bytevector-regex-match-captures r-a #u8"ab") => '(#u8"ab" #u8"a" #u8"b")
(~bytevector-regex-match-captures r-a #u8"") => #f
(~bytevector-regex-match-captures->vector r-a #u8"a") => #(#u8"a" #u8"a" #u8"")
(~bytevector-regex-match-captures->vector r-a #u8"ab") => #(#u8"ab" #u8"a" #u8"b")
(~bytevector-regex-match-captures->vector r-a #u8"") => #f
(~bytevector-regex-match-captures->assoc r-a #u8"a") => '((0 . #u8"a") (1 . #u8"a") (2 . #u8""))
(~bytevector-regex-match-captures->assoc r-a #u8"ab") => '((0 . #u8"ab") (1 . #u8"a") (2 . #u8"b"))
(~bytevector-regex-match-captures->assoc r-a #u8"") => #f
(~bytevector-regex-match-captures-all r-a #u8"a") => '((#u8"a" #u8"a" #u8""))
(~bytevector-regex-match-captures-all r-a #u8"ab") => '((#u8"ab" #u8"a" #u8"b"))
(~bytevector-regex-match-captures-all r-a #u8"") => #f
(~bytevector-regex-match-captures-all->vector r-a #u8"a") => #(#(#u8"a" #u8"a" #u8""))
(~bytevector-regex-match-captures-all->vector r-a #u8"ab") => #(#(#u8"ab" #u8"a" #u8"b"))
(~bytevector-regex-match-captures-all->vector r-a #u8"") => #f
(~bytevector-regex-match-captures-all->assoc r-a #u8"a") => '(((0 . #u8"a") (1 . #u8"a") (2 . #u8"")))
(~bytevector-regex-match-captures-all->assoc r-a #u8"ab") => '(((0 . #u8"ab") (1 . #u8"a") (2 . #u8"b")))
(~bytevector-regex-match-captures-all->assoc r-a #u8"") => #f
(~bytevector-regex-match-captures-position r-a #u8"a") => '((0 . 1) (0 . 1) (1 . 1))
(~bytevector-regex-match-captures-position r-a #u8"ab") => '((0 . 2) (0 . 1) (1 . 2))
(~bytevector-regex-match-captures-position r-a #u8"") => #f
(~bytevector-regex-match-captures-position->vector r-a #u8"a") => #((0 . 1) (0 . 1) (1 . 1))
(~bytevector-regex-match-captures-position->vector r-a #u8"ab") => #((0 . 2) (0 . 1) (1 . 2))
(~bytevector-regex-match-captures-position->vector r-a #u8"") => #f
(~bytevector-regex-match-captures-position->assoc r-a #u8"a") => '((0 . (0 . 1)) (1 . (0 . 1)) (2 . (1 . 1)))
(~bytevector-regex-match-captures-position->assoc r-a #u8"ab") => '((0 . (0 . 2)) (1 . (0 . 1)) (2 . (1 . 2)))
(~bytevector-regex-match-captures-position->assoc r-a #u8"") => #f
(~bytevector-regex-match-captures-position-all r-a #u8"a") => '(((0 . 1) (0 . 1) (1 . 1)))
(~bytevector-regex-match-captures-position-all r-a #u8"ab") => '(((0 . 2) (0 . 1) (1 . 2)))
(~bytevector-regex-match-captures-position-all r-a #u8"") => #f
(~bytevector-regex-match-captures-position-all->vector r-a #u8"a") => #(#((0 . 1) (0 . 1) (1 . 1)))
(~bytevector-regex-match-captures-position-all->vector r-a #u8"ab") => #(#((0 . 2) (0 . 1) (1 . 2)))
(~bytevector-regex-match-captures-position-all->vector r-a #u8"") => #f
(~bytevector-regex-match-captures-position-all->assoc r-a #u8"a") => '(((0 . (0 . 1)) (1 . (0 . 1)) (2 . (1 . 1))))
(~bytevector-regex-match-captures-position-all->assoc r-a #u8"ab") => '(((0 . (0 . 2)) (1 . (0 . 1)) (2 . (1 . 2))))
(~bytevector-regex-match-captures-position-all->assoc r-a #u8"") => #f
(~bytevector-regex-match-all r-b #u8"") => #f
(~bytevector-regex-match-all r-b #u8"123") => #f
(~bytevector-regex-match-all r-b #u8"a") => '(#u8"a")
(~bytevector-regex-match-all r-b #u8"1a") => '(#u8"a")
(~bytevector-regex-match-all r-b #u8"a2") => '(#u8"a")
(~bytevector-regex-match-all r-b #u8"1a2") => '(#u8"a")
(~bytevector-regex-match-all r-b #u8"1a2a3") => '(#u8"a" #u8"a")
(~bytevector-regex-match-all r-b #u8"1aa2ab3ac4") => '(#u8"aa" #u8"ab" #u8"ac")
(~bytevector-regex-match-captures-all r-b #u8"") => #f
(~bytevector-regex-match-captures-all r-b #u8"123") => #f
(~bytevector-regex-match-captures-all r-b #u8"a") => '((#u8"a" #u8"a" #f #f))
(~bytevector-regex-match-captures-all r-b #u8"1a") => '((#u8"a" #u8"a" #f #f))
(~bytevector-regex-match-captures-all r-b #u8"a2") => '((#u8"a" #u8"a" #f #f))
(~bytevector-regex-match-captures-all r-b #u8"1a2") => '((#u8"a" #u8"a" #f #f))
(~bytevector-regex-match-captures-all r-b #u8"1a2a3") => '((#u8"a" #u8"a" #f #f) (#u8"a" #u8"a" #f #f))
(~bytevector-regex-match-captures-all r-b #u8"1aa2ab3ac4") => '((#u8"aa" #u8"aa" #f #f) (#u8"ab" #u8"a" #u8"b" #f) (#u8"ac" #u8"a" #f #u8"c"))
(~bytevector-regex-match-captures-position-all r-b #u8"") => #f
(~bytevector-regex-match-captures-position-all r-b #u8"123") => #f
(~bytevector-regex-match-captures-position-all r-b #u8"a") => '(((0 . 1) (0 . 1) #f #f))
(~bytevector-regex-match-captures-position-all r-b #u8"1a") => '(((1 . 2) (1 . 2) #f #f))
(~bytevector-regex-match-captures-position-all r-b #u8"a2") => '(((0 . 1) (0 . 1) #f #f))
(~bytevector-regex-match-captures-position-all r-b #u8"1a2") => '(((1 . 2) (1 . 2) #f #f))
(~bytevector-regex-match-captures-position-all r-b #u8"1a2a3") => '(((1 . 2) (1 . 2) #f #f) ((3 . 4) (3 . 4) #f #f))
(~bytevector-regex-match-captures-position-all r-b #u8"1aa2ab3ac4") => '(((1 . 3) (1 . 3) #f #f) ((4 . 6) (4 . 5) (5 . 6) #f) ((7 . 9) (7 . 8) #f (8 . 9)))