* Bug #13795 fixed - grep with regexp option did not match the empty string properly
[scilab.git] / scilab / modules / string / tests / unit_tests / grep.tst
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2007-2008 - INRIA
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7
8 // <-- CLI SHELL MODE -->
9
10 lf = ascii(10);
11
12 //===============================
13 // unit tests grep
14 //===============================
15 txt=["find matches of a string in a vector of strings"
16 "search position of a character string in an other string"
17 "Compare Strings"];
18 //===============================
19 if grep(txt,"vide")<>[] then pause,end
20 if grep([],"vide")<>[] then pause,end
21 if grep("","vide")<>[] then pause,end
22 e="";if execstr("grep(txt,e)","errcatch")==0 then pause,end
23 //===============================
24 if grep(txt,"strings")<>1 then pause,end
25 if or(grep(txt,["strings" "Strings"])<>[1 3]) then pause,end
26 //===============================
27 [r,w]=grep(txt,["strings" "Strings"]);
28 if or(w<>[1 2])|or(r<>[1 3]) then pause,end
29 //===============================
30 e=["strings" ""]; if execstr("[r,w]=grep(txt,e)","errcatch")==0 then pause,end;
31 //===============================
32 if grep([]," ") <> [] then pause,end
33 //===============================
34 if grep("AB",["A","B"]) <> 1 then pause,end
35 //===============================
36 if grep("AB",["A";"B"]) <> 1 then pause,end
37 //===============================
38 if grep(["AB","B"],["A";"B"]) <> 1 then pause,end
39 //===============================
40 if grep(["AB","B"],["A";"B";"C"]) <> 1 then pause,end
41 //===============================
42 fd = mopen(SCI+"/modules/string/tests/unit_tests/text.txt","r");
43 txt = mgetl( fd );
44 mclose( fd );
45 //===============================
46 if grep(txt,"scilab") <> [] then pause,end
47 //===============================
48 ref = [ 1., 3., 5., 32., 48., 83., 110., 114., 162., 175., 177., 272., 365., 390., 402., 404., 408.];
49 if grep(txt,"Scilab") <> ref then pause,end
50 //===============================
51 if grep("abc"                                     ,"/abc/"                                 ,"r") <>  1   then pause,end
52 if grep("xbc"                                     ,"/abc/"                                 ,"r") <>  []  then pause,end
53 if grep("axc"                                     ,"/abc/"                                 ,"r") <>  []  then pause,end
54 if grep("abx"                                     ,"/abc/"                                 ,"r") <>  []  then pause,end
55 if grep("xabcy"                                   ,"/abc/"                                 ,"r") <>  1   then pause,end
56 if grep("ababc"                                   ,"/abc/"                                 ,"r") <>  1   then pause,end
57 if grep("abc"                                     ,"/ab*c/"                                ,"r") <>  1   then pause,end
58 if grep("abc"                                     ,"/ab*bc/"                               ,"r") <>  1   then pause,end
59 if grep("abbc"                                    ,"/ab*bc/"                               ,"r") <>  1   then pause,end
60 if grep("abbbbc"                                  ,"/ab*bc/"                               ,"r") <>  1   then pause,end
61 if grep("abbbbc"                                  ,"/.{1}/"                                ,"r") <>  1   then pause,end
62 if grep("abbbbc"                                  ,"/.{3,4}/"                              ,"r") <>  1   then pause,end
63 if grep("abbbbc"                                  ,"/ab{0,}bc/"                            ,"r") <>  1   then pause,end
64 if grep("abbc"                                    ,"/ab+bc/"                               ,"r") <>  1   then pause,end
65 if grep("abc"                                     ,"/ab+bc/"                               ,"r") <>  []  then pause,end
66 if grep("abq"                                     ,"/ab+bc/"                               ,"r") <>  []  then pause,end
67 if grep("abq"                                     ,"/ab{1,}bc/"                            ,"r") <>  []  then pause,end
68 if grep("abbbbc"                                  ,"/ab+bc/"                               ,"r") <>  1   then pause,end
69 if grep("abbbbc"                                  ,"/ab{1,}bc/"                            ,"r") <>  1   then pause,end
70 if grep("abbbbc"                                  ,"/ab{1,3}bc/"                           ,"r") <>  1   then pause,end
71 if grep("abbbbc"                                  ,"/ab{3,4}bc/"                           ,"r") <>  1   then pause,end
72 if grep("abbbbc"                                  ,"/ab{4,5}bc/"                           ,"r") <>  []  then pause,end
73 if grep("abbc"                                    ,"/ab?bc/"                               ,"r") <>  1   then pause,end
74 if grep("abc"                                     ,"/ab?bc/"                               ,"r") <>  1   then pause,end
75 if grep("abc"                                     ,"/ab{0,1}bc/"                           ,"r") <>  1   then pause,end
76 if grep("abbbbc"                                  ,"/ab?bc/"                               ,"r") <>  []  then pause,end
77 if grep("abc"                                     ,"/ab?c/"                                ,"r") <>  1   then pause,end
78 if grep("abc"                                     ,"/ab{0,1}c/"                            ,"r") <>  1   then pause,end
79 if grep("abc"                                     ,"/^abc$/"                               ,"r") <>  1   then pause,end
80 if grep("abcc"                                    ,"/^abc$/"                               ,"r") <>  []  then pause,end
81 if grep("abcc"                                    ,"/^abc/"                                ,"r") <>  1   then pause,end
82 if grep("aabc"                                    ,"/^abc$/"                               ,"r") <>  []  then pause,end
83 if grep("aabc"                                    ,"/abc$/"                                ,"r") <>  1   then pause,end
84 if grep("aabcd"                                   ,"/abc$/"                                ,"r") <>  []  then pause,end
85 if grep("abc"                                     ,"/^/"                                   ,"r") <>  1   then pause,end
86 if grep("abc"                                     ,"/$/"                                   ,"r") <>  1   then pause,end
87 if grep("abc"                                     ,"/a.c/"                                 ,"r") <>  1   then pause,end
88 if grep("axc"                                     ,"/a.c/"                                 ,"r") <>  1   then pause,end
89 if grep("axyzc"                                   ,"/a.*c/"                                ,"r") <>  1   then pause,end
90 if grep("axyzd"                                   ,"/a.*c/"                                ,"r") <>  []  then pause,end
91 if grep("abc"                                     ,"/a[bc]d/"                              ,"r") <>  []  then pause,end
92 if grep("abd"                                     ,"/a[bc]d/"                              ,"r") <>  1   then pause,end
93 if grep("abd"                                     ,"/a[b-d]e/"                             ,"r") <>  []  then pause,end
94 if grep("ace"                                     ,"/a[b-d]e/"                             ,"r") <>  1   then pause,end
95 if grep("aac"                                     ,"/a[b-d]/"                              ,"r") <>  1   then pause,end
96 if grep("a-"                                      ,"/a[-b]/"                               ,"r") <>  1   then pause,end
97 if grep("a-"                                      ,"/a[b-]/"                               ,"r") <>  1   then pause,end
98 if grep("a]"                                      ,"/a]/"                                  ,"r") <>  1   then pause,end
99 if grep("a]b"                                     ,"/a[]]b/"                               ,"r") <>  1   then pause,end
100 if grep("aed"                                     ,"/a[^bc]d/"                             ,"r") <>  1   then pause,end
101 if grep("abd"                                     ,"/a[^bc]d/"                             ,"r") <>  []  then pause,end
102 if grep("adc"                                     ,"/a[^-b]c/"                             ,"r") <>  1   then pause,end
103 if grep("a-c"                                     ,"/a[^-b]c/"                             ,"r") <>  []  then pause,end
104 if grep("a]c"                                     ,"/a[^]b]c/"                             ,"r") <>  []  then pause,end
105 if grep("adc"                                     ,"/a[^]b]c/"                             ,"r") <>  1   then pause,end
106 if grep("a-"                                      ,"/\ba\b/"                               ,"r") <>  1   then pause,end
107 if grep("-a"                                      ,"/\ba\b/"                               ,"r") <>  1   then pause,end
108 if grep("-a-"                                     ,"/\ba\b/"                               ,"r") <>  1   then pause,end
109 if grep("xy"                                      ,"/\by\b/"                               ,"r") <>  []  then pause,end
110 if grep("yz"                                      ,"/\by\b/"                               ,"r") <>  []  then pause,end
111 if grep("xyz"                                     ,"/\by\b/"                               ,"r") <>  []  then pause,end
112 if grep("a-"                                      ,"/\Ba\B/"                               ,"r") <>  []  then pause,end
113 if grep("-a"                                      ,"/\Ba\B/"                               ,"r") <>  []  then pause,end
114 if grep("-a-"                                     ,"/\Ba\B/"                               ,"r") <>  []  then pause,end
115 if grep("xy"                                      ,"/\By\b/"                               ,"r") <>  1   then pause,end
116 if grep("xy"                                      ,"/\By\b/"                               ,"r") <>  1   then pause,end
117 if grep("yz"                                      ,"/\by\B/"                               ,"r") <>  1   then pause,end
118 if grep("xyz"                                     ,"/\By\B/"                               ,"r") <>  1   then pause,end
119 if grep("a"                                       ,"/\w/"                                  ,"r") <>  1   then pause,end
120 if grep("-"                                       ,"/\w/"                                  ,"r") <>  []  then pause,end
121 if grep("a"                                       ,"/\W/"                                  ,"r") <>  []  then pause,end
122 if grep("-"                                       ,"/\W/"                                  ,"r") <>  1   then pause,end
123 if grep("a b"                                     ,"/a\sb/"                                ,"r") <>  1   then pause,end
124 if grep("a-b"                                     ,"/a\sb/"                                ,"r") <>  []  then pause,end
125 if grep("a b"                                     ,"/a\Sb/"                                ,"r") <>  []  then pause,end
126 if grep("a-b"                                     ,"/a\Sb/"                                ,"r") <>  1   then pause,end
127 if grep("1"                                       ,"/\d/"                                  ,"r") <>  1   then pause,end
128 if grep("-"                                       ,"/\d/"                                  ,"r") <>  []  then pause,end
129 if grep("1"                                       ,"/\D/"                                  ,"r") <>  []  then pause,end
130 if grep("-"                                       ,"/\D/"                                  ,"r") <>  1   then pause,end
131 if grep("a"                                       ,"/[\w]/"                                ,"r") <>  1   then pause,end
132 if grep("-"                                       ,"/[\w]/"                                ,"r") <>  []  then pause,end
133 if grep("a"                                       ,"/[\W]/"                                ,"r") <>  []  then pause,end
134 if grep("-"                                       ,"/[\W]/"                                ,"r") <>  1   then pause,end
135 if grep("a b"                                     ,"/a[\s]b/"                              ,"r") <>  1   then pause,end
136 if grep("a-b"                                     ,"/a[\s]b/"                              ,"r") <>  []  then pause,end
137 if grep("a b"                                     ,"/a[\S]b/"                              ,"r") <>  []  then pause,end
138 if grep("a-b"                                     ,"/a[\S]b/"                              ,"r") <>  1   then pause,end
139 if grep("1"                                       ,"/[\d]/"                                ,"r") <>  1   then pause,end
140 if grep("-"                                       ,"/[\d]/"                                ,"r") <>  []  then pause,end
141 if grep("1"                                       ,"/[\D]/"                                ,"r") <>  []  then pause,end
142 if grep("-"                                       ,"/[\D]/"                                ,"r") <>  1   then pause,end
143 if grep("abc"                                     ,"/ab|cd/"                               ,"r") <>  1   then pause,end
144 if grep("abcd"                                    ,"/ab|cd/"                               ,"r") <>  1   then pause,end
145 if grep("b"                                       ,"/$b/"                                  ,"r") <>  []  then pause,end
146 if grep("ab"                                      ,"/a\(*b/"                               ,"r") <>  1   then pause,end
147 if grep("a((b"                                    ,"/a\(*b/"                               ,"r") <>  1   then pause,end
148 if grep("aabbabc"                                 ,"/a+b+c/"                               ,"r") <>  1   then pause,end
149 if grep("aabbabc"                                 ,"/a{1,}b{1,}c/"                         ,"r") <>  1   then pause,end
150 if grep("abcabc"                                  ,"/a.+?c/"                               ,"r") <>  1   then pause,end
151 if grep("cde"                                     ,"/[^ab]*/"                              ,"r") <>  1   then pause,end
152 if grep(""                                        ,"/abc/"                                 ,"r") <>  []  then pause,end
153 if grep(""                                        ,"/a+/"                                  ,"r") <>  []  then pause,end
154 if grep("e"                                       ,"/a|b|c|d|e/"                           ,"r") <>  1   then pause,end
155 if grep("abcdefg"                                 ,"/abcd*efg/"                            ,"r") <>  1   then pause,end
156 if grep("xabyabbbz"                               ,"/ab*/"                                 ,"r") <>  1   then pause,end
157 if grep("xayabbbz"                                ,"/ab*/"                                 ,"r") <>  1   then pause,end
158 if grep("hij"                                     ,"/[abhgefdc]ij/"                        ,"r") <>  1   then pause,end
159 if grep("abcde"                                   ,"/^(ab|cd)e/"                           ,"r") <>  []  then pause,end
160 if grep("adcdcde"                                 ,"/a[bcd]*dcdcde/"                       ,"r") <>  1   then pause,end
161 if grep("adcdcde"                                 ,"/a[bcd]+dcdcde/"                       ,"r") <>  []  then pause,end
162 if grep("alpha"                                   ,"/[a-zA-Z_][a-zA-Z0-9_]*/"              ,"r") <>  1   then pause,end
163 if grep("effg"                                    ,"/(bc+d$|ef*g.|h?i(j|k))/"              ,"r") <>  []  then pause,end
164 if grep("bcdd"                                    ,"/(bc+d$|ef*g.|h?i(j|k))/"              ,"r") <>  []  then pause,end
165 if grep("aa"                                      ,"/((((((((((a))))))))))\10/"            ,"r") <>  1   then pause,end
166 if grep("aa"                                      ,"/((((((((((a))))))))))\041/"           ,"r") <>  []  then pause,end
167 if grep("a!"                                      ,"/((((((((((a))))))))))\041/"           ,"r") <>  1   then pause,end
168 if grep("a"                                       ,"/(((((((((a)))))))))/"                 ,"r") <>  1   then pause,end
169 if grep("uh-uh"                                   ,"/multiple words of text/"              ,"r") <>  []  then pause,end
170 if grep("multiple words, yeah"                    ,"/multiple words/"                      ,"r") <>  1   then pause,end
171 if grep("ab"                                      ,"/[k]/"                                 ,"r") <>  []  then pause,end
172 if grep("ac"                                      ,"/a[-]?c/"                              ,"r") <>  1   then pause,end
173 if grep("a"                                       ,"/(a)|\1/"                              ,"r") <>  1   then pause,end
174 if grep("x"                                       ,"/(a)|\1/"                              ,"r") <>  []  then pause,end
175 if grep("aaxabxbaxbbx"                            ,"/((\3|b)\2(a)x)+/"                     ,"r") <>  []  then pause,end
176 if grep("ABC"                                     ,"/abc/i"                                ,"r") <>  1   then pause,end
177 if grep("XBC"                                     ,"/abc/i"                                ,"r") <>  []  then pause,end
178 if grep("AXC"                                     ,"/abc/i"                                ,"r") <>  []  then pause,end
179 if grep("ABX"                                     ,"/abc/i"                                ,"r") <>  []  then pause,end
180 if grep("XABCY"                                   ,"/abc/i"                                ,"r") <>  1   then pause,end
181 if grep("ABABC"                                   ,"/abc/i"                                ,"r") <>  1   then pause,end
182 if grep("ABC"                                     ,"/ab*c/i"                               ,"r") <>  1   then pause,end
183 if grep("ABC"                                     ,"/ab*bc/i"                              ,"r") <>  1   then pause,end
184 if grep("ABBC"                                    ,"/ab*bc/i"                              ,"r") <>  1   then pause,end
185 if grep("ABBBBC"                                  ,"/ab*?bc/i"                             ,"r") <>  1   then pause,end
186 if grep("ABBBBC"                                  ,"/ab{0,}?bc/i"                          ,"r") <>  1   then pause,end
187 if grep("ABBC"                                    ,"/ab+?bc/i"                             ,"r") <>  1   then pause,end
188 if grep("ABC"                                     ,"/ab+bc/i"                              ,"r") <>  []  then pause,end
189 if grep("ABQ"                                     ,"/ab+bc/i"                              ,"r") <>  []  then pause,end
190 if grep("ABQ"                                     ,"/ab{1,}bc/i"                           ,"r") <>  []  then pause,end
191 if grep("ABBBBC"                                  ,"/ab+bc/i"                              ,"r") <>  1   then pause,end
192 if grep("ABBBBC"                                  ,"/ab{1,}?bc/i"                          ,"r") <>  1   then pause,end
193 if grep("ABBBBC"                                  ,"/ab{1,3}?bc/i"                         ,"r") <>  1   then pause,end
194 if grep("ABBBBC"                                  ,"/ab{3,4}?bc/i"                         ,"r") <>  1   then pause,end
195 if grep("ABBBBC"                                  ,"/ab{4,5}?bc/i"                         ,"r") <>  []  then pause,end
196 if grep("ABBC"                                    ,"/ab??bc/i"                             ,"r") <>  1   then pause,end
197 if grep("ABC"                                     ,"/ab??bc/i"                             ,"r") <>  1   then pause,end
198 if grep("ABC"                                     ,"/ab{0,1}?bc/i"                         ,"r") <>  1   then pause,end
199 if grep("ABBBBC"                                  ,"/ab??bc/i"                             ,"r") <>  []  then pause,end
200 if grep("ABC"                                     ,"/ab??c/i"                              ,"r") <>  1   then pause,end
201 if grep("ABC"                                     ,"/ab{0,1}?c/i"                          ,"r") <>  1   then pause,end
202 if grep("ABC"                                     ,"/^abc$/i"                              ,"r") <>  1   then pause,end
203 if grep("ABCC"                                    ,"/^abc$/i"                              ,"r") <>  []  then pause,end
204 if grep("ABCC"                                    ,"/^abc/i"                               ,"r") <>  1   then pause,end
205 if grep("AABC"                                    ,"/^abc$/i"                              ,"r") <>  []  then pause,end
206 if grep("AABC"                                    ,"/abc$/i"                               ,"r") <>  1   then pause,end
207 if grep("ABC"                                     ,"/^/i"                                  ,"r") <>  1   then pause,end
208 if grep("ABC"                                     ,"/$/i"                                  ,"r") <>  1   then pause,end
209 if grep("ABC"                                     ,"/a.c/i"                                ,"r") <>  1   then pause,end
210 if grep("AXC"                                     ,"/a.c/i"                                ,"r") <>  1   then pause,end
211 if grep("AXYZC"                                   ,"/a.*?c/i"                              ,"r") <>  1   then pause,end
212 if grep("AXYZD"                                   ,"/a.*c/i"                               ,"r") <>  []  then pause,end
213 if grep("ABC"                                     ,"/a[bc]d/i"                             ,"r") <>  []  then pause,end
214 if grep("ABD"                                     ,"/a[bc]d/i"                             ,"r") <>  1   then pause,end
215 if grep("ABD"                                     ,"/a[b-d]e/i"                            ,"r") <>  []  then pause,end
216 if grep("ACE"                                     ,"/a[b-d]e/i"                            ,"r") <>  1   then pause,end
217 if grep("AAC"                                     ,"/a[b-d]/i"                             ,"r") <>  1   then pause,end
218 if grep("A-"                                      ,"/a[-b]/i"                              ,"r") <>  1   then pause,end
219 if grep("A-"                                      ,"/a[b-]/i"                              ,"r") <>  1   then pause,end
220 if grep("A]"                                      ,"/a]/i"                                 ,"r") <>  1   then pause,end
221 if grep("A]B"                                     ,"/a[]]b/i"                              ,"r") <>  1   then pause,end
222 if grep("AED"                                     ,"/a[^bc]d/i"                            ,"r") <>  1   then pause,end
223 if grep("ABD"                                     ,"/a[^bc]d/i"                            ,"r") <>  []  then pause,end
224 if grep("ADC"                                     ,"/a[^-b]c/i"                            ,"r") <>  1   then pause,end
225 if grep("A-C"                                     ,"/a[^-b]c/i"                            ,"r") <>  []  then pause,end
226 if grep("A]C"                                     ,"/a[^]b]c/i"                            ,"r") <>  []  then pause,end
227 if grep("ADC"                                     ,"/a[^]b]c/i"                            ,"r") <>  1   then pause,end
228 if grep("ABC"                                     ,"/ab|cd/i"                              ,"r") <>  1   then pause,end
229 if grep("ABCD"                                    ,"/ab|cd/i"                              ,"r") <>  1   then pause,end
230 if grep("B"                                       ,"/$b/i"                                 ,"r") <>  []  then pause,end
231 if grep("AB"                                      ,"/a\(*b/i"                              ,"r") <>  1   then pause,end
232 if grep("A((B"                                    ,"/a\(*b/i"                              ,"r") <>  1   then pause,end
233 if grep("AABBABC"                                 ,"/a+b+c/i"                              ,"r") <>  1   then pause,end
234 if grep("AABBABC"                                 ,"/a{1,}b{1,}c/i"                        ,"r") <>  1   then pause,end
235 if grep("ABCABC"                                  ,"/a.+?c/i"                              ,"r") <>  1   then pause,end
236 if grep("ABCABC"                                  ,"/a.*?c/i"                              ,"r") <>  1   then pause,end
237 if grep("ABCABC"                                  ,"/a.{0,5}?c/i"                          ,"r") <>  1   then pause,end
238 if grep("CDE"                                     ,"/[^ab]*/i"                             ,"r") <>  1   then pause,end
239 if grep(""                                        ,"/abc/i"                                ,"r") <>  []  then pause,end
240 if grep(""                                        ,"/a+/i"                                 ,"r") <>  []  then pause,end
241 if grep("E"                                       ,"/a|b|c|d|e/i"                          ,"r") <>  1   then pause,end
242 if grep("ABCDEFG"                                 ,"/abcd*efg/i"                           ,"r") <>  1   then pause,end
243 if grep("XABYABBBZ"                               ,"/ab*/i"                                ,"r") <>  1   then pause,end
244 if grep("XAYABBBZ"                                ,"/ab*/i"                                ,"r") <>  1   then pause,end
245 if grep("HIJ"                                     ,"/[abhgefdc]ij/i"                       ,"r") <>  1   then pause,end
246 if grep("ABCDE"                                   ,"/^(ab|cd)e/i"                          ,"r") <>  []  then pause,end
247 if grep("ADCDCDE"                                 ,"/a[bcd]*dcdcde/i"                      ,"r") <>  1   then pause,end
248 if grep("ADCDCDE"                                 ,"/a[bcd]+dcdcde/i"                      ,"r") <>  []  then pause,end
249 if grep("ALPHA"                                   ,"/[a-zA-Z_][a-zA-Z0-9_]*/i"             ,"r") <>  1   then pause,end
250 if grep("EFFG"                                    ,"/(bc+d$|ef*g.|h?i(j|k))/i"             ,"r") <>  []  then pause,end
251 if grep("BCDD"                                    ,"/(bc+d$|ef*g.|h?i(j|k))/i"             ,"r") <>  []  then pause,end
252 if grep("AA"                                      ,"/((((((((((a))))))))))\10/i"           ,"r") <>  1   then pause,end
253 if grep("AA"                                      ,"/((((((((((a))))))))))\041/i"          ,"r") <>  []  then pause,end
254 if grep("A!"                                      ,"/((((((((((a))))))))))\041/i"          ,"r") <>  1   then pause,end
255 if grep("A"                                       ,"/(((((((((a)))))))))/i"                ,"r") <>  1   then pause,end
256 if grep("UH-UH"                                   ,"/multiple words of text/i"             ,"r") <>  []  then pause,end
257 if grep("MULTIPLE WORDS, YEAH"                    ,"/multiple words/i"                     ,"r") <>  1   then pause,end
258 if grep("AB"                                      ,"/[k]/i"                                ,"r") <>  []  then pause,end
259 if grep("AC"                                      ,"/a[-]?c/i"                             ,"r") <>  1   then pause,end
260 if grep("abad"                                    ,"/a(?!b)./"                             ,"r") <>  1   then pause,end
261 if grep("abad"                                    ,"/a(?=d)./"                             ,"r") <>  1   then pause,end
262 if grep("abad"                                    ,"/a(?=c|d)./"                           ,"r") <>  1   then pause,end
263 if grep("<&OUT"                                   ,"/^[<>]&/"                              ,"r") <>  1   then pause,end
264 if grep("aaaaaaaaa"                               ,"/^(a\1?){4}$/"                         ,"r") <>  []  then pause,end
265 if grep("aaaaaaaaaaa"                             ,"/^(a\1?){4}$/"                         ,"r") <>  []  then pause,end
266 if grep("aaaaaaaaa"                               ,"/^(a(?(1)\1)){4}$/"                    ,"r") <>  []  then pause,end
267 if grep("aaaaaaaaaaa"                             ,"/^(a(?(1)\1)){4}$/"                    ,"r") <>  []  then pause,end
268 if grep("ab"                                      ,"/(?<=a)b/"                             ,"r") <>  1   then pause,end
269 if grep("cb"                                      ,"/(?<=a)b/"                             ,"r") <>  []  then pause,end
270 if grep("b"                                       ,"/(?<=a)b/"                             ,"r") <>  []  then pause,end
271 if grep("ab"                                      ,"/(?<!c)b/"                             ,"r") <>  1   then pause,end
272 if grep("cb"                                      ,"/(?<!c)b/"                             ,"r") <>  []  then pause,end
273 if grep("b"                                       ,"/(?<!c)b/"                             ,"r") <>  1   then pause,end
274 if grep("b"                                       ,"/(?<!c)b/"                             ,"r") <>  1   then pause,end
275 if grep("aba"                                     ,"/(?:..)*a/"                            ,"r") <>  1   then pause,end
276 if grep("aba"                                     ,"/(?:..)*?a/"                           ,"r") <>  1   then pause,end
277 if grep("abc"                                     ,"/^(?:b|a(?=(.)))*\1/"                  ,"r") <>  1   then pause,end
278 if grep("ab"                                      ,"/(?:(?i)a)b/"                          ,"r") <>  1   then pause,end
279 if grep("Ab"                                      ,"/(?:(?i)a)b/"                          ,"r") <>  1   then pause,end
280 if grep("aB"                                      ,"/(?:(?i)a)b/"                          ,"r") <>  []  then pause,end
281 if grep("aB"                                      ,"/((?i)a)b/"                            ,"r") <>  []  then pause,end
282 if grep("ab"                                      ,"/(?i:a)b/"                             ,"r") <>  1   then pause,end
283 if grep("Ab"                                      ,"/(?i:a)b/"                             ,"r") <>  1   then pause,end
284 if grep("aB"                                      ,"/(?i:a)b/"                             ,"r") <>  []  then pause,end
285 if grep("aB"                                      ,"/((?i:a))b/"                           ,"r") <>  []  then pause,end
286 if grep("ab"                                      ,"/(?:(?-i)a)b/i"                        ,"r") <>  1   then pause,end
287 if grep("aB"                                      ,"/(?:(?-i)a)b/i"                        ,"r") <>  1   then pause,end
288 if grep("Ab"                                      ,"/(?:(?-i)a)b/i"                        ,"r") <>  []  then pause,end
289 if grep("Ab"                                      ,"/((?-i)a)b/i"                          ,"r") <>  []  then pause,end
290 if grep("aB"                                      ,"/(?:(?-i)a)b/i"                        ,"r") <>  1   then pause,end
291 if grep("AB"                                      ,"/(?:(?-i)a)b/i"                        ,"r") <>  []  then pause,end
292 if grep("AB"                                      ,"/((?-i)a)b/i"                          ,"r") <>  []  then pause,end
293 if grep("ab"                                      ,"/(?-i:a)b/i"                           ,"r") <>  1   then pause,end
294 if grep("aB"                                      ,"/(?-i:a)b/i"                           ,"r") <>  1   then pause,end
295 if grep("Ab"                                      ,"/(?-i:a)b/i"                           ,"r") <>  []  then pause,end
296 if grep("Ab"                                      ,"/((?-i:a))b/i"                         ,"r") <>  []  then pause,end
297 if grep("aB"                                      ,"/(?-i:a)b/i"                           ,"r") <>  1   then pause,end
298 if grep("AB"                                      ,"/(?-i:a)b/i"                           ,"r") <>  []  then pause,end
299 if grep("AB"                                      ,"/((?-i:a))b/i"                         ,"r") <>  []  then pause,end
300 if grep("a"+lf+"B"                                ,"/((?-i:a.))b/i"                        ,"r") <>  []  then pause,end
301 if grep("B"+lf+"B"                                ,"/((?s-i:a.))b/i"                       ,"r") <>  []  then pause,end
302 if grep("cabbbb"                                  ,"/(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/","r") <>  1   then pause,end
303 if grep("caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/","r") <>  1   then pause,end
304 if grep("foobar1234baz"                           ,"/foo\w*\d{4}baz/"                      ,"r") <>  1   then pause,end
305 if grep("x~~"                                     ,"/x(~~)*(?:(?:F)?)?/"                   ,"r") <>  1   then pause,end
306 if grep("aaac"                                    ,"/^a(?#xxx){3}c/"                       ,"r") <>  1   then pause,end
307 if grep("aaac"                                    ,"/^a (?#xxx) (?#yyy) {3}c/x"            ,"r") <>  1   then pause,end
308 if grep("dbcb"                                    ,"/(?<![cd])b/"                          ,"r") <>  []  then pause,end
309 if grep("dbaacb"                                  ,"/(?<![cd])[ab]/"                       ,"r") <>  1   then pause,end
310 if grep("dbcb"                                    ,"/(?<!(c|d))b/"                         ,"r") <>  []  then pause,end
311 if grep("dbaacb"                                  ,"/(?<!(c|d))[ab]/"                      ,"r") <>  1   then pause,end
312 if grep("cdaccb"                                  ,"/(?<!cd)[ab]/"                         ,"r") <>  1   then pause,end
313 if grep("a--"                                     ,"/^(?:a?b?)*$/"                         ,"r") <>  []  then pause,end
314 if grep("a"+lf+"b"+lf                             ,"/(?m)^b/"                              ,"r") <>  1   then pause,end
315 if grep("a"+lf+"b"+lf+"c"+lf                      ,"/^b/"                                  ,"r") <>  []  then pause,end
316 if grep("a"+lf+"b"+lf+"c"+lf                      ,"/()^b/"                                ,"r") <>  []  then pause,end
317 if grep("a"                                       ,"/(x)?(?(1)a|b)/"                       ,"r") <>  []  then pause,end
318 if grep("a"                                       ,"/(x)?(?(1)b|a)/"                       ,"r") <>  1   then pause,end
319 if grep("a"                                       ,"/()?(?(1)b|a)/"                        ,"r") <>  1   then pause,end
320 if grep("a"                                       ,"/()(?(1)b|a)/"                         ,"r") <>  []  then pause,end
321 if grep("a"                                       ,"/()?(?(1)a|b)/"                        ,"r") <>  1   then pause,end
322 if grep("blah)"                                   ,"/^(\()?blah(?(1)(\)))$/"               ,"r") <>  []  then pause,end
323 if grep("(blah"                                   ,"/^(\()?blah(?(1)(\)))$/"               ,"r") <>  []  then pause,end
324 if grep("blah)"                                   ,"/^(\(+)?blah(?(1)(\)))$/"              ,"r") <>  []  then pause,end
325 if grep("(blah"                                   ,"/^(\(+)?blah(?(1)(\)))$/"              ,"r") <>  []  then pause,end
326 if grep("a"                                       ,"/(?(?!a)a|b)/"                         ,"r") <>  []  then pause,end
327 if grep("a"                                       ,"/(?(?!a)b|a)/"                         ,"r") <>  1   then pause,end
328 if grep("a"                                       ,"/(?(?=a)b|a)/"                         ,"r") <>  []  then pause,end
329 if grep("a"                                       ,"/(?(?=a)a|b)/"                         ,"r") <>  1   then pause,end
330 if grep("aaab"                                    ,"/^(?=(a+?))\1ab/"                      ,"r") <>  []  then pause,end
331 if grep("aaab"                                    ,"/^(?=(a+?))\1ab/"                      ,"r") <>  []  then pause,end
332 if grep("abcd:"                                   ,"/([\w:]+::)?(\w+)$/"                   ,"r") <>  []  then pause,end
333 if grep("abcd:"                                   ,"/([\w:]+::)?(\w+)$/"                   ,"r") <>  []  then pause,end
334 if grep("aaab"                                    ,"/(>a+)ab/"                             ,"r") <>  []  then pause,end
335 if grep("aaab"                                    ,"/(?>a+)b/"                             ,"r") <>  1   then pause,end
336 if grep("abc"                                     ,"/[a[:]b[:c]/"                          ,"r") <>  1   then pause,end
337 if grep("abc"                                     ,"/[a[:]b[:c]/"                          ,"r") <>  1   then pause,end
338 if grep("((abc(ade)ufh()()x"                      ,"/((?>[^()]+)|\([^()]*\))+/"            ,"r") <>  1   then pause,end
339 if grep("a"+lf+"b"+lf                             ,"/a\Z/"                                 ,"r") <>  []  then pause,end
340 if grep("a"+lf+"b"+lf                             ,"/a\z/"                                 ,"r") <>  []  then pause,end
341 if grep("a"+lf+"b"+lf                             ,"/a$/"                                  ,"r") <>  []  then pause,end
342 if grep("b"+lf+"a"+lf                             ,"/a\z/"                                 ,"r") <>  []  then pause,end
343 if grep("a"+lf+"b"+lf                             ,"/a\Z/m"                                ,"r") <>  []  then pause,end
344 if grep("a"+lf+"b"+lf                             ,"/a\z/m"                                ,"r") <>  []  then pause,end
345 if grep("b"+lf+"a"+lf                             ,"/a\z/m"                                ,"r") <>  []  then pause,end
346 if grep("aa"+lf+"b"+lf                            ,"/aa\Z/"                                ,"r") <>  []  then pause,end
347 if grep("aa"+lf+"b"+lf                            ,"/aa\z/"                                ,"r") <>  []  then pause,end
348 if grep("aa"+lf+"b"+lf                            ,"/aa$/"                                 ,"r") <>  []  then pause,end
349 if grep("b"+lf+"aa"+lf                            ,"/aa\z/"                                ,"r") <>  []  then pause,end
350 if grep("aa"+lf+"b"+lf                            ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
351 if grep("aa"+lf+"b"+lf                            ,"/aa\z/m"                               ,"r") <>  []  then pause,end
352 if grep("b"+lf+"aa"+lf                            ,"/aa\z/m"                               ,"r") <>  []  then pause,end
353 if grep("ac"+lf+"b"+lf                            ,"/aa\Z/"                                ,"r") <>  []  then pause,end
354 if grep("ac"+lf+"b"+lf                            ,"/aa\z/"                                ,"r") <>  []  then pause,end
355 if grep("ac"+lf+"b"+lf                            ,"/aa$/"                                 ,"r") <>  []  then pause,end
356 if grep("b"+lf+"ac"+lf                            ,"/aa\Z/"                                ,"r") <>  []  then pause,end
357 if grep("b"+lf+"ac"+lf                            ,"/aa\z/"                                ,"r") <>  []  then pause,end
358 if grep("b"+lf+"ac"+lf                            ,"/aa$/"                                 ,"r") <>  []  then pause,end
359 if grep("b"+lf+"ac"                               ,"/aa\Z/"                                ,"r") <>  []  then pause,end
360 if grep("b"+lf+"ac"                               ,"/aa\z/"                                ,"r") <>  []  then pause,end
361 if grep("b"+lf+"ac"                               ,"/aa$/"                                 ,"r") <>  []  then pause,end
362 if grep("ac"+lf+"b"+lf                            ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
363 if grep("ac"+lf+"b"+lf                            ,"/aa\z/m"                               ,"r") <>  []  then pause,end
364 if grep("ac"+lf+"b"+lf                            ,"/aa$/m"                                ,"r") <>  []  then pause,end
365 if grep("b"+lf+"ac"+lf                            ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
366 if grep("b"+lf+"ac"+lf                            ,"/aa\z/m"                               ,"r") <>  []  then pause,end
367 if grep("b"+lf+"ac"+lf                            ,"/aa$/m"                                ,"r") <>  []  then pause,end
368 if grep("b"+lf+"ac"                               ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
369 if grep("b"+lf+"ac"                               ,"/aa\z/m"                               ,"r") <>  []  then pause,end
370 if grep("b"+lf+"ac"                               ,"/aa$/m"                                ,"r") <>  []  then pause,end
371 if grep("ca"+lf+"b"+lf                            ,"/aa\Z/"                                ,"r") <>  []  then pause,end
372 if grep("ca"+lf+"b"+lf                            ,"/aa\z/"                                ,"r") <>  []  then pause,end
373 if grep("ca"+lf+"b"+lf                            ,"/aa$/"                                 ,"r") <>  []  then pause,end
374 if grep("b"+lf+"ca"+lf                            ,"/aa\Z/"                                ,"r") <>  []  then pause,end
375 if grep("b"+lf+"ca"+lf                            ,"/aa\z/"                                ,"r") <>  []  then pause,end
376 if grep("b"+lf+"ca"+lf                            ,"/aa$/"                                 ,"r") <>  []  then pause,end
377 if grep("b"+lf+"ca"                               ,"/aa\Z/"                                ,"r") <>  []  then pause,end
378 if grep("b"+lf+"ca"                               ,"/aa\z/"                                ,"r") <>  []  then pause,end
379 if grep("b"+lf+"ca"                               ,"/aa$/"                                 ,"r") <>  []  then pause,end
380 if grep("ca"+lf+"b"+lf                            ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
381 if grep("ca"+lf+"b"+lf                            ,"/aa\z/m"                               ,"r") <>  []  then pause,end
382 if grep("ca"+lf+"b"+lf                            ,"/aa$/m"                                ,"r") <>  []  then pause,end
383 if grep("b"+lf+"ca"+lf                            ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
384 if grep("b"+lf+"ca"+lf                            ,"/aa\z/m"                               ,"r") <>  []  then pause,end
385 if grep("b"+lf+"ca"+lf                            ,"/aa$/m"                                ,"r") <>  []  then pause,end
386 if grep("b"+lf+"ca"                               ,"/aa\Z/m"                               ,"r") <>  []  then pause,end
387 if grep("b"+lf+"ca"                               ,"/aa\z/m"                               ,"r") <>  []  then pause,end
388 if grep("b"+lf+"ca"                               ,"/aa$/m"                                ,"r") <>  []  then pause,end
389 if grep("ab"+lf+"b"+lf                            ,"/ab\Z/"                                ,"r") <>  []  then pause,end
390 if grep("ab"+lf+"b"+lf                            ,"/ab\z/"                                ,"r") <>  []  then pause,end
391 if grep("ab"+lf+"b"+lf                            ,"/ab$/"                                 ,"r") <>  []  then pause,end
392 if grep("b"+lf+"ab"+lf                            ,"/ab\z/"                                ,"r") <>  []  then pause,end
393 if grep("ab"+lf+"b"+lf                            ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
394 if grep("ab"+lf+"b"+lf                            ,"/ab\z/m"                               ,"r") <>  []  then pause,end
395 if grep("b"+lf+"ab"+lf                            ,"/ab\z/m"                               ,"r") <>  []  then pause,end
396 if grep("ac"+lf+"b"+lf                            ,"/ab\Z/"                                ,"r") <>  []  then pause,end
397 if grep("ac"+lf+"b"+lf                            ,"/ab\z/"                                ,"r") <>  []  then pause,end
398 if grep("ac"+lf+"b"+lf                            ,"/ab$/"                                 ,"r") <>  []  then pause,end
399 if grep("b"+lf+"ac"+lf                            ,"/ab\Z/"                                ,"r") <>  []  then pause,end
400 if grep("b"+lf+"ac"+lf                            ,"/ab\z/"                                ,"r") <>  []  then pause,end
401 if grep("b"+lf+"ac"+lf                            ,"/ab$/"                                 ,"r") <>  []  then pause,end
402 if grep("b"+lf+"ac"                               ,"/ab\Z/"                                ,"r") <>  []  then pause,end
403 if grep("b"+lf+"ac"                               ,"/ab\z/"                                ,"r") <>  []  then pause,end
404 if grep("b"+lf+"ac"                               ,"/ab$/"                                 ,"r") <>  []  then pause,end
405 if grep("ac"+lf+"b"+lf                            ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
406 if grep("ac"+lf+"b"+lf                            ,"/ab\z/m"                               ,"r") <>  []  then pause,end
407 if grep("ac"+lf+"b"+lf                            ,"/ab$/m"                                ,"r") <>  []  then pause,end
408 if grep("b"+lf+"ac"+lf                            ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
409 if grep("b"+lf+"ac"+lf                            ,"/ab\z/m"                               ,"r") <>  []  then pause,end
410 if grep("b"+lf+"ac"+lf                            ,"/ab$/m"                                ,"r") <>  []  then pause,end
411 if grep("b"+lf+"ac"                               ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
412 if grep("b"+lf+"ac"                               ,"/ab\z/m"                               ,"r") <>  []  then pause,end
413 if grep("b"+lf+"ac"                               ,"/ab$/m"                                ,"r") <>  []  then pause,end
414 if grep("ca"+lf+"b"+lf                            ,"/ab\Z/"                                ,"r") <>  []  then pause,end
415 if grep("ca"+lf+"b"+lf                            ,"/ab\z/"                                ,"r") <>  []  then pause,end
416 if grep("ca"+lf+"b"+lf                            ,"/ab$/"                                 ,"r") <>  []  then pause,end
417 if grep("b"+lf+"ca"+lf                            ,"/ab\Z/"                                ,"r") <>  []  then pause,end
418 if grep("b"+lf+"ca"+lf                            ,"/ab\z/"                                ,"r") <>  []  then pause,end
419 if grep("b"+lf+"ca"+lf                            ,"/ab$/"                                 ,"r") <>  []  then pause,end
420 if grep("b"+lf+"ca"                               ,"/ab\Z/"                                ,"r") <>  []  then pause,end
421 if grep("b"+lf+"ca"                               ,"/ab\z/"                                ,"r") <>  []  then pause,end
422 if grep("b"+lf+"ca"                               ,"/ab$/"                                 ,"r") <>  []  then pause,end
423 if grep("ca"+lf+"b"+lf                            ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
424 if grep("ca"+lf+"b"+lf                            ,"/ab\z/m"                               ,"r") <>  []  then pause,end
425 if grep("ca"+lf+"b"+lf                            ,"/ab$/m"                                ,"r") <>  []  then pause,end
426 if grep("b"+lf+"ca"+lf                            ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
427 if grep("b"+lf+"ca"+lf                            ,"/ab\z/m"                               ,"r") <>  []  then pause,end
428 if grep("b"+lf+"ca"+lf                            ,"/ab$/m"                                ,"r") <>  []  then pause,end
429 if grep("b"+lf+"ca"                               ,"/ab\Z/m"                               ,"r") <>  []  then pause,end
430 if grep("b"+lf+"ca"                               ,"/ab\z/m"                               ,"r") <>  []  then pause,end
431 if grep("b"+lf+"ca"                               ,"/ab$/m"                                ,"r") <>  []  then pause,end
432 if grep("abb"+lf+"b"+lf                           ,"/abb\Z/"                               ,"r") <>  []  then pause,end
433 if grep("abb"+lf+"b"+lf                           ,"/abb\z/"                               ,"r") <>  []  then pause,end
434 if grep("abb"+lf+"b"+lf                           ,"/abb$/"                                ,"r") <>  []  then pause,end
435 if grep("b"+lf+"abb"+lf                           ,"/abb\z/"                               ,"r") <>  []  then pause,end
436 if grep("abb"+lf+"b"+lf                           ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
437 if grep("abb"+lf+"b"+lf                           ,"/abb\z/m"                              ,"r") <>  []  then pause,end
438 if grep("b"+lf+"abb"+lf                           ,"/abb\z/m"                              ,"r") <>  []  then pause,end
439 if grep("ac"+lf+"b"+lf                            ,"/abb\Z/"                               ,"r") <>  []  then pause,end
440 if grep("ac"+lf+"b"+lf                            ,"/abb\z/"                               ,"r") <>  []  then pause,end
441 if grep("ac"+lf+"b"+lf                            ,"/abb$/"                                ,"r") <>  []  then pause,end
442 if grep("b"+lf+"ac"+lf                            ,"/abb\Z/"                               ,"r") <>  []  then pause,end
443 if grep("b"+lf+"ac"+lf                            ,"/abb\z/"                               ,"r") <>  []  then pause,end
444 if grep("b"+lf+"ac"+lf                            ,"/abb$/"                                ,"r") <>  []  then pause,end
445 if grep("b"+lf+"ac"                               ,"/abb\Z/"                               ,"r") <>  []  then pause,end
446 if grep("b"+lf+"ac"                               ,"/abb\z/"                               ,"r") <>  []  then pause,end
447 if grep("b"+lf+"ac"                               ,"/abb$/"                                ,"r") <>  []  then pause,end
448 if grep("ac"+lf+"b"+lf                            ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
449 if grep("ac"+lf+"b"+lf                            ,"/abb\z/m"                              ,"r") <>  []  then pause,end
450 if grep("ac"+lf+"b"+lf                            ,"/abb$/m"                               ,"r") <>  []  then pause,end
451 if grep("b"+lf+"ac"+lf                            ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
452 if grep("b"+lf+"ac"+lf                            ,"/abb\z/m"                              ,"r") <>  []  then pause,end
453 if grep("b"+lf+"ac"+lf                            ,"/abb$/m"                               ,"r") <>  []  then pause,end
454 if grep("b"+lf+"ac"                               ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
455 if grep("b"+lf+"ac"                               ,"/abb\z/m"                              ,"r") <>  []  then pause,end
456 if grep("b"+lf+"ac"                               ,"/abb$/m"                               ,"r") <>  []  then pause,end
457 if grep("ca"+lf+"b"+lf                            ,"/abb\Z/"                               ,"r") <>  []  then pause,end
458 if grep("ca"+lf+"b"+lf                            ,"/abb\z/"                               ,"r") <>  []  then pause,end
459 if grep("ca"+lf+"b"+lf                            ,"/abb$/"                                ,"r") <>  []  then pause,end
460 if grep("b"+lf+"ca"+lf                            ,"/abb\Z/"                               ,"r") <>  []  then pause,end
461 if grep("b"+lf+"ca"+lf                            ,"/abb\z/"                               ,"r") <>  []  then pause,end
462 if grep("b"+lf+"ca"+lf                            ,"/abb$/"                                ,"r") <>  []  then pause,end
463 if grep("b"+lf+"ca"                               ,"/abb\Z/"                               ,"r") <>  []  then pause,end
464 if grep("b"+lf+"ca"                               ,"/abb\z/"                               ,"r") <>  []  then pause,end
465 if grep("b"+lf+"ca"                               ,"/abb$/"                                ,"r") <>  []  then pause,end
466 if grep("ca"+lf+"b"+lf                            ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
467 if grep("ca"+lf+"b"+lf                            ,"/abb\z/m"                              ,"r") <>  []  then pause,end
468 if grep("ca"+lf+"b"+lf                            ,"/abb$/m"                               ,"r") <>  []  then pause,end
469 if grep("b"+lf+"ca"+lf                            ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
470 if grep("b"+lf+"ca"+lf                            ,"/abb\z/m"                              ,"r") <>  []  then pause,end
471 if grep("b"+lf+"ca"+lf                            ,"/abb$/m"                               ,"r") <>  []  then pause,end
472 if grep("b"+lf+"ca"                               ,"/abb\Z/m"                              ,"r") <>  []  then pause,end
473 if grep("b"+lf+"ca"                               ,"/abb\z/m"                              ,"r") <>  []  then pause,end
474 if grep("b"+lf+"ca"                               ,"/abb$/m"                               ,"r") <>  []  then pause,end
475 if grep("x"                                       ,"/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/","r") <>  []  then pause,end
476 if grep("foo.bart"                                ,"/foo.bart/"                            ,"r") <>  1   then pause,end
477 if grep("abcd"+lf+"dxxx"                          ,"/^d[x][x][x]/m"                        ,"r") <>  1   then pause,end
478 if grep("xxxtt"                                   ,"/tt+$/"                                ,"r") <>  1   then pause,end
479 if grep("aaaXbX"                                  ,"/\GX.*X/"                              ,"r") <>  []  then pause,end
480 if grep("Changes"                                 ,"/\.c(pp|xx|c)?$/i"                     ,"r") <>  []  then pause,end
481 if grep("IO.c"                                    ,"/\.c(pp|xx|c)?$/i"                     ,"r") <>  1   then pause,end
482 if grep("C:/"                                     ,"/^([a-z]:)/"                           ,"r") <>  []  then pause,end
483 if grep(lf+"x aa"                                 ,"/^\S\s+aa$/m"                          ,"r") <>  1   then pause,end
484 if grep("ab"                                      ,"/(^|a)b/"                              ,"r") <>  1   then pause,end
485 if grep("abcab"                                   ,"/(\w)?(abc)\1b/"                       ,"r") <>  []  then pause,end
486 if grep("a,b,c"                                   ,"/^(?:.,){2}c/"                         ,"r") <>  1   then pause,end
487 if grep("a,b,c"                                   ,"/^(?:[^,]*,){2}c/"                     ,"r") <>  1   then pause,end
488 if grep(""                                        ,"/(?i)/"                                ,"r") <>  1  then pause,end
489 if grep("a"+lf+"xb"+lf                            ,"/(?!\A)x/m"                            ,"r") <>  1   then pause,end
490 if grep("123"+lf+"abcabcabcabc"+lf                ,"/^.{9}abc.*\n/m"                       ,"r") <>  1   then pause,end
491 if grep("a"                                       ,"/^(a)?(?(1)a|b)+$/"                    ,"r") <>  []  then pause,end
492 if grep("x1"                                      ,"/^(0+)?(?:x(1))?/"                     ,"r") <>  1   then pause,end
493 if grep("012cxx0190"                              ,"/^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/","r") <>  1   then pause,end
494 if grep("aaaacccc"                                ,"/((?:aaaa|bbbb)cccc)?/"                ,"r") <>  1   then pause,end
495 if grep("bbbbcccc"                                ,"/((?:aaaa|bbbb)cccc)?/"                ,"r") <>  1   then pause,end
496 if grep("a"+lf+"b"+lf                             ,"/b\s^/m"                               ,"r") <>  []  then pause,end
497 if grep("a"                                       ,"/\ba/"                                 ,"r") <>  1   then pause,end
498 if grep("AbCd"                                    ,"/ab(?i)cd/"                            ,"r") <>  []  then pause,end
499 if grep("abCd"                                    ,"/ab(?i)cd/"                            ,"r") <>  1   then pause,end
500 if grep("Oo"                                      ,"/^(o)(?!.*\1)/i"                       ,"r") <>  []  then pause,end
501 if grep("2"                                       ,"/2(]*)?$\1/"                           ,"r") <>  1   then pause,end
502 if grep("......abef"                              ,"/.*a(?!(b|cd)*e).*f/"                  ,"r") <>  []  then pause,end
503 if grep("fools"                                   ,"/(foo|fool|x.|money|parted)$/"         ,"r") <>  []  then pause,end
504 if grep("fools"                                   ,"/(x.|foo|fool|x.|money|parted|y.)$/"   ,"r") <>  []  then pause,end
505 if grep("fools"                                   ,"/(foo|fool|money|parted)$/"            ,"r") <>  []  then pause,end
506 //========================================================================================
507 // depend of PCRE library options
508 //if grep('a\b'                                     ,'/a\\b/'                                ,'r') <>  1   then pause,end
509 //if grep('bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'  ,'/.X(.+)+X/'                            ,'r') <>  1   then pause,end
510 //if grep('bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.X(.+)+XX/'                           ,'r') <>  1   then pause,end
511 //if grep('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.XX(.+)+X/'                           ,'r') <>  1   then pause,end
512 //if grep('bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'  ,'/.X(.+)+X/'                            ,'r') <>  []  then pause,end
513 //if grep('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.X(.+)+XX/'                           ,'r') <>  []  then pause,end
514 //if grep('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.XX(.+)+X/'                           ,'r') <>  []  then pause,end
515 //if grep('bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'  ,'/.X(.+)+[X]/'                          ,'r') <>  1   then pause,end
516 //if grep('bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.X(.+)+[X][X]/'                       ,'r') <>  1   then pause,end
517 //if grep('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.XX(.+)+[X]/'                         ,'r') <>  1   then pause,end
518 //if grep('bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'  ,'/.X(.+)+[X]/'                          ,'r') <>  []  then pause,end
519 //if grep('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.X(.+)+[X][X]/'                       ,'r') <>  []  then pause,end
520 //if grep('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.XX(.+)+[X]/'                         ,'r') <>  []  then pause,end
521 //if grep('bbbbXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'  ,'/.[X](.+)+[X]/'                        ,'r') <>  1   then pause,end
522 //if grep('bbbbXcXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.[X](.+)+[X][X]/'                     ,'r') <>  1   then pause,end
523 //if grep('bbbbXXcXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.[X][X](.+)+[X]/'                     ,'r') <>  1   then pause,end
524 //if grep('bbbbXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'  ,'/.[X](.+)+[X]/'                        ,'r') <>  []  then pause,end
525 //if grep('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.[X](.+)+[X][X]/'                     ,'r') <>  []  then pause,end
526 //if grep('bbbbXXXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' ,'/.[X][X](.+)+[X]/'                     ,'r') <>  []  then pause,end
527 //if grep('cabd'                                    ,'/a(?{})b/'                             ,'r') <>  1   then pause,end
528 //if grep('a'                                       ,'/(?(?{0})b|a)/'                        ,'r') <>  1   then pause,end
529 //if grep('a'                                       ,'/(?(?{1})a|b)/'                        ,'r') <>  1   then pause,end
530 //if grep('x'                                       ,'/(??{})/'                              ,'r') <>  1   then pause,end
531 //if grep('cabd'                                    ,'/a(?{"\{"})b/'                         ,'r') <>  1   then pause,end
532 //if grep('A\B'                                     ,'/a\\b/i'                               ,'r') <>  1   then pause,end
533 //if grep('aaaaaaaaaaaaaaab'                        ,'/(a|aa|aaa|aaaa|aaaaa|aaaaaa)(??{$1&&"foo"})(b|c)/','r') <>  []  then pause,end
534 //========================================================================================
535 str = "世界您好";
536 needle = "界";
537 [r,w] = grep(str,needle);
538 if r <> 1 then pause,end
539 if w <> 1 then pause,end
540
541 str = "азеазея";
542 needle = "з";
543 [r,w] = grep(str,needle);
544 if r <> 1 then pause,end
545 if w <> 1 then pause,end
546
547 str = "ハロー・ワールド";
548 needle = "ワ";
549 [r,w] = grep(str,needle);
550 if r <> 1 then pause,end
551 if w <> 1 then pause,end
552
553 str = "เฮลโลเวิลด์";
554 needle = "วิ";
555 [r,w] = grep(str,needle);
556 if r <> 1 then pause,end
557 if w <> 1 then pause,end
558
559 str = "حريات وحقوق";
560 needle = "و";
561 [r,w] = grep(str,needle);
562 if r <> 1 then pause,end
563 if w <> 1 then pause,end
564
565 str = "תוכנית";
566 needle = "ו";
567 grep(str,needle);
568 if r <> 1 then pause,end
569 if w <> 1 then pause,end
570
571 //========================================================================================
572 // Chinese
573 str = "世界您好";
574 [r,w] = grep(str,"/^世界/","r");
575 if r <> 1 then pause,end
576 if w <> 1 then pause,end
577
578 [r,w] = grep(str,"/世界$/","r");
579 if r <> [] then pause,end
580 if w <> [] then pause,end
581
582 [r,w] = grep(str,"/您好$/","r");
583 if r <> 1 then pause,end
584 if w <> 1 then pause,end
585
586 [r,w] = grep(str,"/^您好/","r");
587 if r <> [] then pause,end
588 if w <> [] then pause,end
589
590 [r,w] = grep(str,"/界您/","r");
591 if r <> 1 then pause,end
592 if w <> 1 then pause,end
593
594 [r,w] = grep(str,"界您");
595 if r <> 1 then pause,end
596 if w <> 1 then pause,end
597
598 [r,w] = grep(str,"/界_您/","r");
599 if r <> [] then pause,end
600 if w <> [] then pause,end
601 //========================================================================================
602 // Russian
603 str = "привет мир";
604 [r,w] = grep(str,"/^привет/","r");
605 if r <> 1 then pause,end
606 if w <> 1 then pause,end
607
608 [r,w] = grep(str,"/привет$/","r");
609 if r <> [] then pause,end
610 if w <> [] then pause,end
611
612 [r,w] = grep(str,"/мир$/","r");
613 if r <> 1 then pause,end
614 if w <> 1 then pause,end
615
616 [r,w] = grep(str,"/^мир/","r");
617 if r <> [] then pause,end
618 if w <> [] then pause,end
619
620 [r,w] = grep(str,"/вет\sм/","r");
621 if r <> 1 then pause,end
622 if w <> 1 then pause,end
623
624 [r,w] = grep(str,"/вет_м/","r");
625 if r <> [] then pause,end
626 if w <> [] then pause,end
627 //========================================================================================
628 // Cyrilic
629 str = "АБВГДЄЖЅЗИІКЛМНОПҀРСТѸФХѠЦЧШЩЪЪІЬѢЮѦѨѪѬѮѰѲѴѤ";
630
631 [r,w] = grep(str,"/^АБВГДЄЖЅЗИІКЛМНОПҀР/","r");
632 if r <> 1 then pause,end
633 if w <> 1 then pause,end
634
635 [r,w] = grep(str,"/АБВГДЄЖЅЗИІКЛМНОПҀР$/","r");
636 if r <> [] then pause,end
637 if w <> [] then pause,end
638
639 [r,w] = grep(str,"/ЧШЩЪЪІЬѢЮѦѨѪѬѮѰѲѴѤ$/","r");
640 if r <> 1 then pause,end
641 if w <> 1 then pause,end
642
643 [r,w] = grep(str,"/^ЧШЩЪЪІЬѢЮѦѨѪѬѮѰѲѴѤ/","r");
644 if r <> [] then pause,end
645 if w <> [] then pause,end
646
647 [r,w] = grep(str,"/ИІКЛМНОПҀРСТѸФХѠЦЧШЩЪ/","r");
648 if r <> 1 then pause,end
649 if w <> 1 then pause,end
650
651 [r,w] = grep(str,"/ИІКЛМНОПҀ_РСТѸФХѠЦЧШЩЪ/","r");
652 if r <> [] then pause,end
653 if w <> [] then pause,end
654 //========================================================================================
655 // Japanese
656 str = "丑丞串乃之乎也云亘亙些亦亥亨亮仔伊伎伍伽佃佑伶侃侑俄侠俣俐侶倭俺倶倦倖偲僅傭儲允兎兜其冥冴冶凄凌凜凛凧凪凰凱函刹劉劫勁勃";
657
658 [r,w] = grep(str,"/^丑丞串乃之乎也云亘亙些亦/","r");
659 if r <> 1 then pause,end
660 if w <> 1 then pause,end
661
662 [r,w] = grep(str,"/丑丞串乃之乎也云亘亙些亦$/","r");
663 if r <> [] then pause,end
664 if w <> [] then pause,end
665
666 [r,w] = grep(str,"/凰凱函刹劉劫勁勃$/","r");
667 if r <> 1 then pause,end
668 if w <> 1 then pause,end
669
670 [r,w] = grep(str,"/^凰凱函刹劉劫勁勃/","r");
671 if r <> [] then pause,end
672 if w <> [] then pause,end
673
674 [r,w] = grep(str,"/亨亮仔伊伎伍伽佃佑伶侃/","r");
675 if r <> 1 then pause,end
676 if w <> 1 then pause,end
677
678 [r,w] = grep(str,"/亨亮仔伊_伎伍伽佃佑伶侃/","r");
679 if r <> [] then pause,end
680 if w <> [] then pause,end
681 //========================================================================================
682 // Thaï
683 str = "มกระดุกกระดิก";
684 [r,w] = grep(str,"/^มกระดุกกร/","r");
685 if r <> 1 then pause,end
686 if w <> 1 then pause,end
687
688 [r,w] = grep(str,"/มกระดุกกร$/","r");
689 if r <> [] then pause,end
690 if w <> [] then pause,end
691
692 [r,w] = grep(str,"/กกระดิก$/","r");
693 if r <> 1 then pause,end
694 if w <> 1 then pause,end
695
696 [r,w] = grep(str,"/^กกระดิก/","r");
697 if r <> [] then pause,end
698 if w <> [] then pause,end
699
700 [r,w] = grep(str,"/ดุกก/","r");
701 if r <> 1 then pause,end
702 if w <> 1 then pause,end
703
704 [r,w] = grep(str,"/ดุก_ก/","r");
705 if r <> [] then pause,end
706 if w <> [] then pause,end
707 //========================================================================================