1 USING: regexp tools.test kernel sequences regexp.parser
2 regexp.traversal eval strings multiline ;
8 [ f ] [ "b" "a*" <regexp> matches? ] unit-test
9 [ t ] [ "" "a*" <regexp> matches? ] unit-test
10 [ t ] [ "a" "a*" <regexp> matches? ] unit-test
11 [ t ] [ "aaaaaaa" "a*" <regexp> matches? ] unit-test
12 [ f ] [ "ab" "a*" <regexp> matches? ] unit-test
14 [ t ] [ "abc" "abc" <regexp> matches? ] unit-test
15 [ t ] [ "a" "a|b|c" <regexp> matches? ] unit-test
16 [ t ] [ "b" "a|b|c" <regexp> matches? ] unit-test
17 [ t ] [ "c" "a|b|c" <regexp> matches? ] unit-test
18 [ f ] [ "c" "d|e|f" <regexp> matches? ] unit-test
20 [ t ] [ "b" "|b" <regexp> matches? ] unit-test
21 [ t ] [ "b" "b|" <regexp> matches? ] unit-test
22 [ t ] [ "" "b|" <regexp> matches? ] unit-test
23 [ t ] [ "" "b|" <regexp> matches? ] unit-test
24 [ f ] [ "" "|" <regexp> matches? ] unit-test
25 [ f ] [ "" "|||||||" <regexp> matches? ] unit-test
27 [ f ] [ "aa" "a|b|c" <regexp> matches? ] unit-test
28 [ f ] [ "bb" "a|b|c" <regexp> matches? ] unit-test
29 [ f ] [ "cc" "a|b|c" <regexp> matches? ] unit-test
30 [ f ] [ "cc" "d|e|f" <regexp> matches? ] unit-test
32 [ f ] [ "" "a+" <regexp> matches? ] unit-test
33 [ t ] [ "a" "a+" <regexp> matches? ] unit-test
34 [ t ] [ "aa" "a+" <regexp> matches? ] unit-test
36 [ t ] [ "" "a?" <regexp> matches? ] unit-test
37 [ t ] [ "a" "a?" <regexp> matches? ] unit-test
38 [ f ] [ "aa" "a?" <regexp> matches? ] unit-test
40 [ f ] [ "" "." <regexp> matches? ] unit-test
41 [ t ] [ "a" "." <regexp> matches? ] unit-test
42 [ t ] [ "." "." <regexp> matches? ] unit-test
44 ! Dotall mode -- when on, . matches newlines.
46 [ f ] [ "\n" "." <regexp> matches? ] unit-test
47 [ t ] [ "\n" "(?s)." <regexp> matches? ] unit-test
48 [ t ] [ "\n" R/ ./s matches? ] unit-test
49 [ f ] [ "\n\n" "(?s).(?-s)." <regexp> matches? ] unit-test
51 [ f ] [ "" ".+" <regexp> matches? ] unit-test
52 [ t ] [ "a" ".+" <regexp> matches? ] unit-test
53 [ t ] [ "ab" ".+" <regexp> matches? ] unit-test
55 [ t ] [ " " "[\\s]" <regexp> matches? ] unit-test
56 [ f ] [ "a" "[\\s]" <regexp> matches? ] unit-test
57 [ f ] [ " " "[\\S]" <regexp> matches? ] unit-test
58 [ t ] [ "a" "[\\S]" <regexp> matches? ] unit-test
59 [ f ] [ " " "[\\w]" <regexp> matches? ] unit-test
60 [ t ] [ "a" "[\\w]" <regexp> matches? ] unit-test
61 [ t ] [ " " "[\\W]" <regexp> matches? ] unit-test
62 [ f ] [ "a" "[\\W]" <regexp> matches? ] unit-test
64 [ t ] [ "/" "\\/" <regexp> matches? ] unit-test
66 [ t ] [ "a" R' a'i matches? ] unit-test
68 [ t ] [ "" "a|b*|c+|d?" <regexp> matches? ] unit-test
69 [ t ] [ "a" "a|b*|c+|d?" <regexp> matches? ] unit-test
70 [ t ] [ "c" "a|b*|c+|d?" <regexp> matches? ] unit-test
71 [ t ] [ "cc" "a|b*|c+|d?" <regexp> matches? ] unit-test
72 [ f ] [ "ccd" "a|b*|c+|d?" <regexp> matches? ] unit-test
73 [ t ] [ "d" "a|b*|c+|d?" <regexp> matches? ] unit-test
75 [ t ] [ "foo" "foo|bar" <regexp> matches? ] unit-test
76 [ t ] [ "bar" "foo|bar" <regexp> matches? ] unit-test
77 [ f ] [ "foobar" "foo|bar" <regexp> matches? ] unit-test
81 [ f ] [ "" "(a)" <regexp> matches? ] unit-test
82 [ t ] [ "a" "(a)" <regexp> matches? ] unit-test
83 [ f ] [ "aa" "(a)" <regexp> matches? ] unit-test
84 [ t ] [ "aa" "(a*)" <regexp> matches? ] unit-test
86 [ f ] [ "aababaaabbac" "(a|b)+" <regexp> matches? ] unit-test
87 [ t ] [ "ababaaabba" "(a|b)+" <regexp> matches? ] unit-test
90 [ f ] [ "" "a{1}" <regexp> matches? ] unit-test
91 [ t ] [ "a" "a{1}" <regexp> matches? ] unit-test
92 [ f ] [ "aa" "a{1}" <regexp> matches? ] unit-test
94 [ f ] [ "a" "a{2,}" <regexp> matches? ] unit-test
95 [ t ] [ "aaa" "a{2,}" <regexp> matches? ] unit-test
96 [ t ] [ "aaaa" "a{2,}" <regexp> matches? ] unit-test
97 [ t ] [ "aaaaa" "a{2,}" <regexp> matches? ] unit-test
99 [ t ] [ "" "a{,2}" <regexp> matches? ] unit-test
100 [ t ] [ "a" "a{,2}" <regexp> matches? ] unit-test
101 [ t ] [ "aa" "a{,2}" <regexp> matches? ] unit-test
102 [ f ] [ "aaa" "a{,2}" <regexp> matches? ] unit-test
103 [ f ] [ "aaaa" "a{,2}" <regexp> matches? ] unit-test
104 [ f ] [ "aaaaa" "a{,2}" <regexp> matches? ] unit-test
106 [ f ] [ "" "a{1,3}" <regexp> matches? ] unit-test
107 [ t ] [ "a" "a{1,3}" <regexp> matches? ] unit-test
108 [ t ] [ "aa" "a{1,3}" <regexp> matches? ] unit-test
109 [ t ] [ "aaa" "a{1,3}" <regexp> matches? ] unit-test
110 [ f ] [ "aaaa" "a{1,3}" <regexp> matches? ] unit-test
112 [ f ] [ "" "[a]" <regexp> matches? ] unit-test
113 [ t ] [ "a" "[a]" <regexp> matches? ] unit-test
114 [ t ] [ "a" "[abc]" <regexp> matches? ] unit-test
115 [ f ] [ "b" "[a]" <regexp> matches? ] unit-test
116 [ f ] [ "d" "[abc]" <regexp> matches? ] unit-test
117 [ t ] [ "ab" "[abc]{1,2}" <regexp> matches? ] unit-test
118 [ f ] [ "abc" "[abc]{1,2}" <regexp> matches? ] unit-test
120 [ f ] [ "" "[^a]" <regexp> matches? ] unit-test
121 [ f ] [ "a" "[^a]" <regexp> matches? ] unit-test
122 [ f ] [ "a" "[^abc]" <regexp> matches? ] unit-test
123 [ t ] [ "b" "[^a]" <regexp> matches? ] unit-test
124 [ t ] [ "d" "[^abc]" <regexp> matches? ] unit-test
125 [ f ] [ "ab" "[^abc]{1,2}" <regexp> matches? ] unit-test
126 [ f ] [ "abc" "[^abc]{1,2}" <regexp> matches? ] unit-test
128 [ t ] [ "]" "[]]" <regexp> matches? ] unit-test
129 [ f ] [ "]" "[^]]" <regexp> matches? ] unit-test
130 [ t ] [ "a" "[^]]" <regexp> matches? ] unit-test
132 [ "^" "[^]" <regexp> matches? ] must-fail
133 [ t ] [ "^" "[]^]" <regexp> matches? ] unit-test
134 [ t ] [ "]" "[]^]" <regexp> matches? ] unit-test
136 [ t ] [ "[" "[[]" <regexp> matches? ] unit-test
137 [ f ] [ "^" "[^^]" <regexp> matches? ] unit-test
138 [ t ] [ "a" "[^^]" <regexp> matches? ] unit-test
140 [ t ] [ "-" "[-]" <regexp> matches? ] unit-test
141 [ f ] [ "a" "[-]" <regexp> matches? ] unit-test
142 [ f ] [ "-" "[^-]" <regexp> matches? ] unit-test
143 [ t ] [ "a" "[^-]" <regexp> matches? ] unit-test
145 [ t ] [ "-" "[-a]" <regexp> matches? ] unit-test
146 [ t ] [ "a" "[-a]" <regexp> matches? ] unit-test
147 [ t ] [ "-" "[a-]" <regexp> matches? ] unit-test
148 [ t ] [ "a" "[a-]" <regexp> matches? ] unit-test
149 [ f ] [ "b" "[a-]" <regexp> matches? ] unit-test
150 [ f ] [ "-" "[^-]" <regexp> matches? ] unit-test
151 [ t ] [ "a" "[^-]" <regexp> matches? ] unit-test
153 [ f ] [ "-" "[a-c]" <regexp> matches? ] unit-test
154 [ t ] [ "-" "[^a-c]" <regexp> matches? ] unit-test
155 [ t ] [ "b" "[a-c]" <regexp> matches? ] unit-test
156 [ f ] [ "b" "[^a-c]" <regexp> matches? ] unit-test
158 [ t ] [ "-" "[a-c-]" <regexp> matches? ] unit-test
159 [ f ] [ "-" "[^a-c-]" <regexp> matches? ] unit-test
161 [ t ] [ "\\" "[\\\\]" <regexp> matches? ] unit-test
162 [ f ] [ "a" "[\\\\]" <regexp> matches? ] unit-test
163 [ f ] [ "\\" "[^\\\\]" <regexp> matches? ] unit-test
164 [ t ] [ "a" "[^\\\\]" <regexp> matches? ] unit-test
166 [ t ] [ "0" "[\\d]" <regexp> matches? ] unit-test
167 [ f ] [ "a" "[\\d]" <regexp> matches? ] unit-test
168 [ f ] [ "0" "[^\\d]" <regexp> matches? ] unit-test
169 [ t ] [ "a" "[^\\d]" <regexp> matches? ] unit-test
173 [ t ] [ "a" "[a-z]{1,}|[A-Z]{2,4}|b*|c|(f|g)*" <regexp> matches? ] unit-test
174 [ t ] [ "a" "[a-z]{1,2}|[A-Z]{3,3}|b*|c|(f|g)*" <regexp> matches? ] unit-test
175 [ t ] [ "a" "[a-z]{1,2}|[A-Z]{3,3}" <regexp> matches? ] unit-test
178 [ t ] [ "1000" "\\d{4,6}" <regexp> matches? ] unit-test
179 [ t ] [ "1000" "[0-9]{4,6}" <regexp> matches? ] unit-test
181 [ t ] [ "abc" "\\p{Lower}{3}" <regexp> matches? ] unit-test
182 [ f ] [ "ABC" "\\p{Lower}{3}" <regexp> matches? ] unit-test
183 [ t ] [ "ABC" "\\p{Upper}{3}" <regexp> matches? ] unit-test
184 [ f ] [ "abc" "\\p{Upper}{3}" <regexp> matches? ] unit-test
185 [ f ] [ "abc" "[\\p{Upper}]{3}" <regexp> matches? ] unit-test
186 [ t ] [ "ABC" "[\\p{Upper}]{3}" <regexp> matches? ] unit-test
188 [ f ] [ "" "\\Q\\E" <regexp> matches? ] unit-test
189 [ f ] [ "a" "\\Q\\E" <regexp> matches? ] unit-test
190 [ t ] [ "|*+" "\\Q|*+\\E" <regexp> matches? ] unit-test
191 [ f ] [ "abc" "\\Q|*+\\E" <regexp> matches? ] unit-test
192 [ t ] [ "s" "\\Qs\\E" <regexp> matches? ] unit-test
194 [ t ] [ "S" "\\0123" <regexp> matches? ] unit-test
195 [ t ] [ "SXY" "\\0123XY" <regexp> matches? ] unit-test
196 [ t ] [ "x" "\\x78" <regexp> matches? ] unit-test
197 [ f ] [ "y" "\\x78" <regexp> matches? ] unit-test
198 [ t ] [ "x" "\\u000078" <regexp> matches? ] unit-test
199 [ f ] [ "y" "\\u000078" <regexp> matches? ] unit-test
201 [ t ] [ "ab" "a+b" <regexp> matches? ] unit-test
202 [ f ] [ "b" "a+b" <regexp> matches? ] unit-test
203 [ t ] [ "aab" "a+b" <regexp> matches? ] unit-test
204 [ f ] [ "abb" "a+b" <regexp> matches? ] unit-test
206 [ t ] [ "abbbb" "ab*" <regexp> matches? ] unit-test
207 [ t ] [ "a" "ab*" <regexp> matches? ] unit-test
208 [ f ] [ "abab" "ab*" <regexp> matches? ] unit-test
210 [ f ] [ "x" "\\." <regexp> matches? ] unit-test
211 [ t ] [ "." "\\." <regexp> matches? ] unit-test
213 [ t ] [ "aaaab" "a+ab" <regexp> matches? ] unit-test
214 [ f ] [ "aaaxb" "a+ab" <regexp> matches? ] unit-test
215 [ t ] [ "aaacb" "a+cb" <regexp> matches? ] unit-test
217 [ 3 ] [ "aaacb" "a*" <regexp> match-head ] unit-test
218 [ 2 ] [ "aaacb" "aa?" <regexp> match-head ] unit-test
220 [ t ] [ "aaa" R/ AAA/i matches? ] unit-test
221 [ f ] [ "aax" R/ AAA/i matches? ] unit-test
222 [ t ] [ "aaa" R/ A*/i matches? ] unit-test
223 [ f ] [ "aaba" R/ A*/i matches? ] unit-test
224 [ t ] [ "b" R/ [AB]/i matches? ] unit-test
225 [ f ] [ "c" R/ [AB]/i matches? ] unit-test
226 [ t ] [ "c" R/ [A-Z]/i matches? ] unit-test
227 [ f ] [ "3" R/ [A-Z]/i matches? ] unit-test
229 [ t ] [ "a" "(?i)a" <regexp> matches? ] unit-test
230 [ t ] [ "a" "(?i)a" <regexp> matches? ] unit-test
231 [ t ] [ "A" "(?i)a" <regexp> matches? ] unit-test
232 [ t ] [ "A" "(?i)a" <regexp> matches? ] unit-test
234 [ t ] [ "a" R/ (?-i)a/i matches? ] unit-test
235 [ t ] [ "a" R/ (?-i)a/i matches? ] unit-test
236 [ f ] [ "A" R/ (?-i)a/i matches? ] unit-test
237 [ f ] [ "A" R/ (?-i)a/i matches? ] unit-test
239 [ f ] [ "A" "[a-z]" <regexp> matches? ] unit-test
240 [ t ] [ "A" R/ [a-z]/i matches? ] unit-test
242 [ f ] [ "A" "\\p{Lower}" <regexp> matches? ] unit-test
243 [ t ] [ "A" R/ \p{Lower}/i matches? ] unit-test
245 [ t ] [ "abc" <reversed> R/ abc/r matches? ] unit-test
246 [ t ] [ "abc" <reversed> R/ a[bB][cC]/r matches? ] unit-test
247 ! [ t ] [ "adcbe" R/ a(?r)(bcd)(?-r)e/ matches? ] unit-test ! FIXME
249 [ t ] [ "s@f" "[a-z.-]@[a-z]" <regexp> matches? ] unit-test
250 [ f ] [ "a" "[a-z.-]@[a-z]" <regexp> matches? ] unit-test
251 [ t ] [ ".o" "\\.[a-z]" <regexp> matches? ] unit-test
253 [ t ] [ "abc*" "[^\\*]*\\*" <regexp> matches? ] unit-test
254 [ t ] [ "bca" "[^a]*a" <regexp> matches? ] unit-test
259 "(0[lL]?|[1-9]\\d{0,9}(\\d{0,9}[lL])?|0[xX]\\p{XDigit}{1,8}(\\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\\.[0-9]*|\\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))"
263 [ ] [ "(\\$[\\p{XDigit}]|[\\p{Digit}])" <regexp> drop ] unit-test
265 ! Comment inside a regular expression
266 [ t ] [ "ac" "a(?#boo)c" <regexp> matches? ] unit-test
268 [ ] [ "USING: regexp kernel ; R' -{3}[+]{1,6}(?:!!)?\\s' drop" eval ] unit-test
270 [ ] [ "USING: regexp kernel ; R' (ftp|http|https)://(\\w+:?\\w*@)?(\\S+)(:[0-9]+)?(/|/([\\w#!:.?+=&%@!\\-/]))?' drop" eval ] unit-test
272 [ ] [ "USING: regexp kernel ; R' \\*[^\s*][^*]*\\*' drop" eval ] unit-test
274 [ "ab" ] [ "ab" "(a|ab)(bc)?" <regexp> first-match >string ] unit-test
275 [ "abc" ] [ "abc" "(a|ab)(bc)?" <regexp> first-match >string ] unit-test
277 [ "ab" ] [ "ab" "(ab|a)(bc)?" <regexp> first-match >string ] unit-test
278 [ "abc" ] [ "abc" "(ab|a)(bc)?" <regexp> first-match >string ] unit-test
280 [ "b" ] [ "aaaaaaaaaaaaaaaaaaaaaaab" "((a*)*b)*b" <regexp> first-match >string ] unit-test
283 ! [ t ] [ "a:b" ".+:?" <regexp> matches? ] unit-test
285 ! [ 1 ] [ "hello" ".+?" <regexp> match length ] unit-test
287 [ { "1" "2" "3" "4" } ]
288 [ "1ABC2DEF3GHI4" R/ [A-Z]+/ re-split [ >string ] map ] unit-test
290 [ { "1" "2" "3" "4" } ]
291 [ "1ABC2DEF3GHI4JK" R/ [A-Z]+/ re-split [ >string ] map ] unit-test
293 [ { "ABC" "DEF" "GHI" } ]
294 [ "1ABC2DEF3GHI4" R/ [A-Z]+/ all-matches [ >string ] map ] unit-test
297 [ "1ABC2DEF3GHI4" R/ [A-Z]+/ count-matches ] unit-test
300 [ "123" R/ [A-Z]+/ count-matches ] unit-test
303 [ "1ABC2DEF3GHI4JK" R/ [A-Z]+/ "." re-replace ] unit-test
305 [ "-- title --" ] [ "== title ==" "=" <regexp> "-" re-replace ] unit-test
309 [ f ] [ "ab" "a(?!b)" <regexp> first-match ] unit-test
310 [ "a" ] [ "ac" "a(?!b)" <regexp> first-match >string ] unit-test
311 ! [ t ] [ "fxxbar" "(?!foo).{3}bar" <regexp> matches? ] unit-test
312 [ f ] [ "foobar" "(?!foo).{3}bar" <regexp> matches? ] unit-test
313 [ "a" ] [ "ab" "a(?=b)(?=b)" <regexp> first-match >string ] unit-test
314 [ "a" ] [ "ba" "a(?<=b)(?<=b)" <regexp> first-match >string ] unit-test
315 [ "a" ] [ "cab" "a(?=b)(?<=c)" <regexp> first-match >string ] unit-test
317 [ 3 ] [ "foobar" "foo(?=bar)" <regexp> match-head ] unit-test
318 [ f ] [ "foobxr" "foo(?=bar)" <regexp> match-head ] unit-test
321 ! Bug in parsing word
322 [ t ] [ "a" R' a' matches? ] unit-test
324 ! Convert to lowercase until E
325 [ f ] [ "AA" R/ \LAA\E/ matches? ] unit-test
326 [ t ] [ "aa" R/ \LAA\E/ matches? ] unit-test
328 ! Convert to uppercase until E
329 [ t ] [ "AA" R/ \Uaa\E/ matches? ] unit-test
330 [ f ] [ "aa" R/ \Uaa\E/ matches? ] unit-test
332 ! [ "{Lower}" <regexp> ] [ invalid-range? ] must-fail-with
334 ! [ t ] [ "a" R/ ^a/ matches? ] unit-test
335 ! [ f ] [ "\na" R/ ^a/ matches? ] unit-test
336 ! [ f ] [ "\r\na" R/ ^a/ matches? ] unit-test
337 ! [ f ] [ "\ra" R/ ^a/ matches? ] unit-test
339 ! [ t ] [ "a" R/ a$/ matches? ] unit-test
340 ! [ f ] [ "a\n" R/ a$/ matches? ] unit-test
341 ! [ f ] [ "a\r" R/ a$/ matches? ] unit-test
342 ! [ f ] [ "a\r\n" R/ a$/ matches? ] unit-test
344 ! [ t ] [ "a" R/ a$|b$/ matches? ] unit-test
345 ! [ t ] [ "b" R/ a$|b$/ matches? ] unit-test
346 ! [ t ] [ "ab" R/ a$|b$/ matches? ] unit-test
347 ! [ t ] [ "ba" R/ ba$|b$/ matches? ] unit-test
349 ! [ t ] [ "a" R/ \Aa/ matches? ] unit-test
350 ! [ f ] [ "\na" R/ \Aaa/ matches? ] unit-test
351 ! [ f ] [ "\r\na" R/ \Aa/ matches? ] unit-test
352 ! [ f ] [ "\ra" R/ \Aa/ matches? ] unit-test
354 ! [ t ] [ "a" R/ \Aa/m matches? ] unit-test
355 ! [ f ] [ "\na" R/ \Aaa/m matches? ] unit-test
356 ! [ f ] [ "\r\na" R/ \Aa/m matches? ] unit-test
357 ! [ f ] [ "\ra" R/ \Aa/m matches? ] unit-test
359 ! [ t ] [ "\r\n\n\n\nam" R/ ^am/m matches? ] unit-test
361 ! [ t ] [ "a" R/ \Aa\z/m matches? ] unit-test
362 ! [ f ] [ "a\n" R/ \Aa\z/m matches? ] unit-test
364 ! [ t ] [ "a\r\n" R/ \Aa\Z/m matches? ] unit-test
365 ! [ t ] [ "a\n" R/ \Aa\Z/m matches? ] unit-test
367 ! [ t ] [ "a" R/ \Aa\Z/m matches? ] unit-test
368 ! [ f ] [ "\na" R/ \Aaa\Z/m matches? ] unit-test
369 ! [ f ] [ "\r\na" R/ \Aa\Z/m matches? ] unit-test
370 ! [ f ] [ "\ra" R/ \Aa\Z/m matches? ] unit-test
372 ! [ t ] [ "a" R/ ^a/m matches? ] unit-test
373 ! [ t ] [ "\na" R/ ^a/m matches? ] unit-test
374 ! [ t ] [ "\r\na" R/ ^a/m matches? ] unit-test
375 ! [ t ] [ "\ra" R/ ^a/m matches? ] unit-test
377 ! [ t ] [ "a" "a$" R/ a$/m matches? ] unit-test
378 ! [ t ] [ "a\n" "a$" R/ a$/m matches? ] unit-test
379 ! [ t ] [ "a\r" "a$" R/ a$/m matches? ] unit-test
380 ! [ t ] [ "a\r\n" "a$" R/ a$/m matches? ] unit-test
382 ! [ f ] [ "foobxr" "foo\\z" <regexp> match-head ] unit-test
383 ! [ 3 ] [ "foo" "foo\\z" <regexp> match-head ] unit-test
385 ! [ t ] [ "foo" "\\bfoo\\b" <regexp> matches? ] unit-test
386 ! [ t ] [ "afoob" "\\Bfoo\\B" <regexp> matches? ] unit-test
387 ! [ t ] [ "afoob" "\\bfoo\\b" <regexp> matches? ] unit-test
388 ! [ f ] [ "foo" "\\Bfoo\\B" <regexp> matches? ] unit-test
390 ! [ 3 ] [ "foo bar" "foo\\b" <regexp> match-head ] unit-test
391 ! [ f ] [ "fooxbar" "foo\\b" <regexp> matches? ] unit-test
392 ! [ t ] [ "foo" "foo\\b" <regexp> matches? ] unit-test
393 ! [ t ] [ "foo bar" "foo\\b bar" <regexp> matches? ] unit-test
394 ! [ f ] [ "fooxbar" "foo\\bxbar" <regexp> matches? ] unit-test
395 ! [ f ] [ "foo" "foo\\bbar" <regexp> matches? ] unit-test
397 ! [ f ] [ "foo bar" "foo\\B" <regexp> matches? ] unit-test
398 ! [ 3 ] [ "fooxbar" "foo\\B" <regexp> match-head ] unit-test
399 ! [ t ] [ "foo" "foo\\B" <regexp> matches? ] unit-test
400 ! [ f ] [ "foo bar" "foo\\B bar" <regexp> matches? ] unit-test
401 ! [ t ] [ "fooxbar" "foo\\Bxbar" <regexp> matches? ] unit-test
402 ! [ f ] [ "foo" "foo\\Bbar" <regexp> matches? ] unit-test
404 ! [ 1 ] [ "aaacb" "a+?" <regexp> match-head ] unit-test
405 ! [ 1 ] [ "aaacb" "aa??" <regexp> match-head ] unit-test
406 ! [ f ] [ "aaaab" "a++ab" <regexp> matches? ] unit-test
407 ! [ t ] [ "aaacb" "a++cb" <regexp> matches? ] unit-test
408 ! [ 3 ] [ "aacb" "aa?c" <regexp> match-head ] unit-test
409 ! [ 3 ] [ "aacb" "aa??c" <regexp> match-head ] unit-test
411 ! "ab" "a(?=b*)" <regexp> match
412 ! "abbbbbc" "a(?=b*c)" <regexp> match
413 ! "ab" "a(?=b*)" <regexp> match
415 ! "baz" "(az)(?<=b)" <regexp> first-match
416 ! "cbaz" "a(?<=b*)" <regexp> first-match
417 ! "baz" "a(?<=b)" <regexp> first-match
419 ! "baz" "a(?<!b)" <regexp> first-match
420 ! "caz" "a(?<!b)" <regexp> first-match
422 ! "abcdefg" "a(?=bcdefg)bcd" <regexp> first-match
423 ! "abcdefg" "a(?#bcdefg)bcd" <regexp> first-match
424 ! "abcdefg" "a(?:bcdefg)" <regexp> first-match
426 ! "caba" "a(?<=b)" <regexp> first-match
428 ! capture group 1: "aaaa" 2: ""
429 ! "aaaa" "(a*)(a*)" <regexp> match*
430 ! "aaaa" "(a*)(a+)" <regexp> match*