]> mj.ucw.cz Git - libucw.git/blob - lib/regex.t
Added bit_array_assign(), replaced BIT_ARRAY_ALLOC by functions.
[libucw.git] / lib / regex.t
1 # Tests for the regex module
2
3 Run:    obj/lib/regex-t 'a.*b.*c'
4 In:     abc
5         ajkhkbbbbbc
6         Aabc
7 Out:    MATCH
8         MATCH
9         NO MATCH
10
11 Run:    obj/lib/regex-t -i 'a.*b.*c'
12 In:     aBc
13         ajkhkbBBBBC
14         Aabc
15 Out:    MATCH
16         MATCH
17         MATCH
18
19 Run:    obj/lib/regex-t -i '(ahoj|nebo)'
20 In:     Ahoj
21         nEBo
22         ahoja
23         (ahoj|nebo)
24 Out:    MATCH
25         MATCH
26         NO MATCH
27         NO MATCH
28
29 Run:    obj/lib/regex-t '\(ahoj\)'
30 In:     (ahoj)
31         ahoj
32 Out:    MATCH
33         NO MATCH
34
35 Run:    obj/lib/regex-t '(.*b)*'
36 In:     ababababab
37         ababababababababababababababababababababababababababababa
38 Out:    MATCH
39         NO MATCH
40
41 Run:    obj/lib/regex-t '(.*)((aabb)|cc)(b.*)' '\1<\3>\4'
42 In:     aaabbb
43         aabbccb
44         abcabc
45         aaccbb
46 Out:    a<aabb>b
47         aabb<>b
48         NO MATCH
49         aa<>bb
50
51 Run:    obj/lib/regex-t '.*\?(.*&)*([a-z_]*sess[a-z_]*|random|sid|S_ID|rnd|timestamp|referer)=.*'
52 In:     /nemecky/ubytovani/hotel.php?sort=&cislo=26&mena=EUR&typ=Hotel&luz1=ANO&luz2=ANO&luz3=&luz4=&luz5=&maxp1=99999&maxp2=99999&maxp3=99999&maxp4=99999&maxp5=99999&apart=&rada=8,9,10,11,19,22,26,27,28,29,3&cislo=26&mena=EUR&typ=Hotel&luz1=ANO&luz2=ANO&luz3=&luz4=&luz5=&maxp1=99999&maxp2=99999&maxp3=99999&maxp4=99999&maxp5=99999&apart=&rada=8,9,10,11,19,22,26,27,28,29,3&cislo=26&mena=EUR&typ=Hotel&luz1=ANO&luz2=ANO&luz3=&luz4=&luz5=&maxp1=99999&maxp2=99999&maxp3=99999&maxp4=99999&maxp5=99999&apart=&rada=8,9,10,11,19,22,26,27,28,29,3
53         /test...?f=1&s=3&sid=123&q=3&
54 Out:    NO MATCH
55         MATCH
56
57 Run:    obj/lib/regex-t '.*[0-9a-f]{8,16}.*'
58 In:     abcdabcdabcd
59         aaaaaaaaaaaaaaaaaaaaaaaaaaaa
60         asddajlkdkajlqwepoiequwiouio
61         000001111p101010101010q12032
62 Out:    MATCH
63         MATCH
64         NO MATCH
65         MATCH