1 # PCRE version 4.4 21-August-2003
3 # Tests taken from PCRE and modified to suit glibc regex.
8 # PCRE is a library of functions to support regular expressions whose syntax
9 # and semantics are as close as possible to those of the Perl 5 language.
11 # Written by: Philip Hazel <ph10@cam.ac.uk>
13 # University of Cambridge Computing Service,
14 # Cambridge, England. Phone: +44 1223 334714.
16 # Copyright (c) 1997-2003 University of Cambridge
18 # Permission is granted to anyone to use this software for any purpose on any
19 # computer system, and to redistribute it freely, subject to the following
22 # 1. This software is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 # 2. The origin of this software must not be misrepresented, either by
27 # explicit claim or by omission. In practice, this means that if you use
28 # PCRE in software that you distribute to others, commercially or
29 # otherwise, you must put a sentence like this
31 # Regular expression support is provided by the PCRE library package,
32 # which is open source software, written by Philip Hazel, and copyright
33 # by the University of Cambridge, England.
35 # somewhere reasonably visible in your documentation and in any relevant
36 # files or online help data or similar. A reference to the ftp site for
37 # the source, that is, to
39 # ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
41 # should also be given in the documentation. However, this condition is not
42 # intended to apply to whole chains of software. If package A includes PCRE,
43 # it must acknowledge it, but if package B is software that includes package
44 # A, the condition is not imposed on package B (unless it uses PCRE
47 # 3. Altered versions must be plainly marked as such, and must not be
48 # misrepresented as being the original software.
50 # 4. If PCRE is embedded in any software that is released under the GNU
51 # General Purpose Licence (GPL), or Lesser General Purpose Licence (LGPL),
52 # then the terms of that licence shall supersede any condition above with
53 # which it is incompatible.
55 # The documentation for PCRE, supplied in the "doc" directory, is distributed
56 # under the same terms as the software itself.
63 0: the quick brown fox
66 What do you know about the quick brown fox?
67 0: the quick brown fox
68 What do you know about THE QUICK BROWN FOX?
71 /The quick brown fox/i
73 0: the quick brown fox
75 0: The quick brown FOX
76 What do you know about the quick brown fox?
77 0: the quick brown fox
78 What do you know about THE QUICK BROWN FOX?
79 0: THE QUICK BROWN FOX
81 /a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/
82 abxyzpqrrrabbxyyyypqAzz
83 0: abxyzpqrrrabbxyyyypqAzz
84 abxyzpqrrrabbxyyyypqAzz
85 0: abxyzpqrrrabbxyyyypqAzz
86 aabxyzpqrrrabbxyyyypqAzz
87 0: aabxyzpqrrrabbxyyyypqAzz
88 aaabxyzpqrrrabbxyyyypqAzz
89 0: aaabxyzpqrrrabbxyyyypqAzz
90 aaaabxyzpqrrrabbxyyyypqAzz
91 0: aaaabxyzpqrrrabbxyyyypqAzz
92 abcxyzpqrrrabbxyyyypqAzz
93 0: abcxyzpqrrrabbxyyyypqAzz
94 aabcxyzpqrrrabbxyyyypqAzz
95 0: aabcxyzpqrrrabbxyyyypqAzz
96 aaabcxyzpqrrrabbxyyyypAzz
97 0: aaabcxyzpqrrrabbxyyyypAzz
98 aaabcxyzpqrrrabbxyyyypqAzz
99 0: aaabcxyzpqrrrabbxyyyypqAzz
100 aaabcxyzpqrrrabbxyyyypqqAzz
101 0: aaabcxyzpqrrrabbxyyyypqqAzz
102 aaabcxyzpqrrrabbxyyyypqqqAzz
103 0: aaabcxyzpqrrrabbxyyyypqqqAzz
104 aaabcxyzpqrrrabbxyyyypqqqqAzz
105 0: aaabcxyzpqrrrabbxyyyypqqqqAzz
106 aaabcxyzpqrrrabbxyyyypqqqqqAzz
107 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz
108 aaabcxyzpqrrrabbxyyyypqqqqqqAzz
109 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz
110 aaaabcxyzpqrrrabbxyyyypqAzz
111 0: aaaabcxyzpqrrrabbxyyyypqAzz
112 abxyzzpqrrrabbxyyyypqAzz
113 0: abxyzzpqrrrabbxyyyypqAzz
114 aabxyzzzpqrrrabbxyyyypqAzz
115 0: aabxyzzzpqrrrabbxyyyypqAzz
116 aaabxyzzzzpqrrrabbxyyyypqAzz
117 0: aaabxyzzzzpqrrrabbxyyyypqAzz
118 aaaabxyzzzzpqrrrabbxyyyypqAzz
119 0: aaaabxyzzzzpqrrrabbxyyyypqAzz
120 abcxyzzpqrrrabbxyyyypqAzz
121 0: abcxyzzpqrrrabbxyyyypqAzz
122 aabcxyzzzpqrrrabbxyyyypqAzz
123 0: aabcxyzzzpqrrrabbxyyyypqAzz
124 aaabcxyzzzzpqrrrabbxyyyypqAzz
125 0: aaabcxyzzzzpqrrrabbxyyyypqAzz
126 aaaabcxyzzzzpqrrrabbxyyyypqAzz
127 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz
128 aaaabcxyzzzzpqrrrabbbxyyyypqAzz
129 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz
130 aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
131 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz
132 aaabcxyzpqrrrabbxyyyypABzz
133 0: aaabcxyzpqrrrabbxyyyypABzz
134 aaabcxyzpqrrrabbxyyyypABBzz
135 0: aaabcxyzpqrrrabbxyyyypABBzz
136 >>>aaabxyzpqrrrabbxyyyypqAzz
137 0: aaabxyzpqrrrabbxyyyypqAzz
138 >aaaabxyzpqrrrabbxyyyypqAzz
139 0: aaaabxyzpqrrrabbxyyyypqAzz
140 >>>>abcxyzpqrrrabbxyyyypqAzz
141 0: abcxyzpqrrrabbxyyyypqAzz
144 abxyzpqrrabbxyyyypqAzz
146 abxyzpqrrrrabbxyyyypqAzz
148 abxyzpqrrrabxyyyypqAzz
150 aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz
152 aaaabcxyzzzzpqrrrabbbxyyypqAzz
154 aaabcxyzpqrrrabbxyyyypqqqqqqqAzz
285 /^.+[0-9][0-9][0-9]$/
299 /^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/
300 abc!pqr=apquxz.ixr.zzz.ac.uk
301 0: abc!pqr=apquxz.ixr.zzz.ac.uk
306 !pqr=apquxz.ixr.zzz.ac.uk
308 abc!=apquxz.ixr.zzz.ac.uk
310 abc!pqr=apquxz:ixr.zzz.ac.uk
312 abc!pqr=apquxz.ixr.zzz.ac.ukk
316 Well, we need a colon: somewhere
355 /^.*\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/
375 /^([0-9]+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
376 1 IN SOA non-sp1 non-sp2(
377 0: 1 IN SOA non-sp1 non-sp2(
381 1 IN SOA non-sp1 non-sp2 (
382 0: 1 IN SOA non-sp1 non-sp2 (
388 1IN SOA non-sp1 non-sp2(
391 /^[a-zA-Z0-9][a-zA-Z0-9-]*(\.[a-zA-Z0-9][a-zA-z0-9-]*)*\.$/
412 /^\*\.[a-z]([a-z0-9-]*[a-z0-9]+)?(\.[a-z]([a-z0-9-]*[a-z0-9]+)?)*$/
438 /^[0-9a-f](\.[0-9a-f])*$/i
463 /^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/
535 /\`(abc|def)=(\1){2,3}\'/
549 /(cat(a(ract|tonic)|erpillar)) \1()2(3)/
551 0: cataract cataract23
557 catatonic catatonic23
558 0: catatonic catatonic23
564 caterpillar caterpillar23
565 0: caterpillar caterpillar23
573 /^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/
574 From abcd Mon Sep 01 12:33:02 1997
575 0: From abcd Mon Sep 01 12:33
578 /^From\s+\S+\s+([a-zA-Z]{3}\s+){2}[0-9]{1,2}\s+[0-9][0-9]:[0-9][0-9]/
579 From abcd Mon Sep 01 12:33:02 1997
580 0: From abcd Mon Sep 01 12:33
582 From abcd Mon Sep 1 12:33:02 1997
583 0: From abcd Mon Sep 1 12:33
587 From abcd Sep 01 12:33:02 1997
691 /([^.]*)\.([^:]*):[T ]+(.*)/
692 track1.title:TBlah blah blah
693 0: track1.title:TBlah blah blah
698 /([^.]*)\.([^:]*):[T ]+(.*)/i
699 track1.title:TBlah blah blah
700 0: track1.title:TBlah blah blah
705 /([^.]*)\.([^:]*):[t ]+(.*)/i
706 track1.title:TBlah blah blah
707 0: track1.title:TBlah blah blah
761 /^([^a])([^b])([^c]*)([^d]{3,4})/
885 /P[^*]TAIRE[^*]{1,6}LL/
886 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
889 /P[^*]TAIRE[^*]{1,}LL/
890 xxxxxxxxxxxPSTAIREISLLxxxxxxxxx
893 /(\.[0-9][0-9][1-9]?)[0-9]+/
905 Food is on the foo table
911 The food is under the bar in the barn.
912 0: food is under the bar in the bar
913 1: d is under the bar in the
916 I have 2 numbers: 53147
917 0: I have 2 numbers: 53147
918 1: I have 2 numbers: 53147
922 I have 2 numbers: 53147
923 0: I have 2 numbers: 53147
924 1: I have 2 numbers: 5314
928 I have 2 numbers: 53147
929 0: I have 2 numbers: 53147
930 1: I have 2 numbers: 5314
934 I have 2 numbers: 53147
935 0: I have 2 numbers: 53147
939 /(.*[^0-9])([0-9]+)$/
940 I have 2 numbers: 53147
941 0: I have 2 numbers: 53147
945 /[[:digit:]][[:digit:]]\/[[:digit:]][[:digit:]]\/[[:digit:]][[:digit:]][[:digit:]][[:digit:]]/
1055 /^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/
1059 /^[[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]][[:digit:]]/
1076 /^[abcdefghijklmnopqrstuvwxy0123456789]/
1663 /[a-zA-Z_][a-zA-Z0-9_]*/
1667 /^a(bc+|b[eh])g|.h$/
1671 /(bc+d$|ef*g.|h?i(j|k))/
1689 /((((((((((a))))))))))/
1703 /((((((((((a))))))))))\9/
1717 /(((((((((a)))))))))/
1730 /multiple words of text/
1739 multiple words, yeah
2100 /[a-zA-Z_][a-zA-Z0-9_]*/i
2104 /^a(bc+|b[eh])g|.h$/i
2108 /(bc+d$|ef*g.|h?i(j|k))/i
2128 /((((((((((a))))))))))/i
2142 /((((((((((a))))))))))\9/i
2156 /(((((((((a)))))))))/i
2169 /multiple words of text/i
2178 MULTIPLE WORDS, YEAH
2284 /((\w|:)+::)?(\w+)$/
2306 /((\w|:)+::)?(\w+)$/