/[pcre]/code/trunk/testdata/testoutput11
ViewVC logotype

Contents of /code/trunk/testdata/testoutput11

Parent Directory Parent Directory | Revision Log Revision Log


Revision 454 - (show annotations) (download)
Tue Sep 22 09:42:11 2009 UTC (5 years, 1 month ago) by ph10
File size: 7837 byte(s)
Allow fixed-length subroutine calls in lookbehinds.

1 /-- These tests are for the Perl 5.10 features that PCRE supports. --/
2
3 /\H\h\V\v/
4 X X\x0a
5 0: X X\x0a
6 X\x09X\x0b
7 0: X\x09X\x0b
8 ** Failers
9 No match
10 \xa0 X\x0a
11 No match
12
13 /\H*\h+\V?\v{3,4}/
14 \x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
15 0: \x09 \xa0X\x0a\x0b\x0c\x0d
16 \x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
17 0: \x09 \xa0\x0a\x0b\x0c\x0d
18 \x09\x20\xa0\x0a\x0b\x0c
19 0: \x09 \xa0\x0a\x0b\x0c
20 ** Failers
21 No match
22 \x09\x20\xa0\x0a\x0b
23 No match
24
25 /\H{3,4}/
26 XY ABCDE
27 0: ABCD
28 XY PQR ST
29 0: PQR
30
31 /.\h{3,4}./
32 XY AB PQRS
33 0: B P
34
35 /\h*X\h?\H+Y\H?Z/
36 >XNNNYZ
37 0: XNNNYZ
38 > X NYQZ
39 0: X NYQZ
40 ** Failers
41 No match
42 >XYZ
43 No match
44 > X NY Z
45 No match
46
47 /\v*X\v?Y\v+Z\V*\x0a\V+\x0b\V{2,3}\x0c/
48 >XY\x0aZ\x0aA\x0bNN\x0c
49 0: XY\x0aZ\x0aA\x0bNN\x0c
50 >\x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
51 0: \x0a\x0dX\x0aY\x0a\x0bZZZ\x0aAAA\x0bNNN\x0c
52
53 /(foo)\Kbar/
54 foobar
55 0: bar
56 1: foo
57
58 /(foo)(\Kbar|baz)/
59 foobar
60 0: bar
61 1: foo
62 2: bar
63 foobaz
64 0: foobaz
65 1: foo
66 2: baz
67
68 /(foo\Kbar)baz/
69 foobarbaz
70 0: barbaz
71 1: foobar
72
73 /abc\K|def\K/g+
74 Xabcdefghi
75 0:
76 0+ defghi
77 0:
78 0+ ghi
79
80 /ab\Kc|de\Kf/g+
81 Xabcdefghi
82 0: c
83 0+ defghi
84 0: f
85 0+ ghi
86
87 /(?=C)/g+
88 ABCDECBA
89 0:
90 0+ CDECBA
91 0:
92 0+ CBA
93
94 /^abc\K/+
95 abcdef
96 0:
97 0+ def
98 ** Failers
99 No match
100 defabcxyz
101 No match
102
103 /^(a(b))\1\g1\g{1}\g-1\g{-1}\g{-02}Z/
104 ababababbbabZXXXX
105 0: ababababbbabZ
106 1: ab
107 2: b
108
109 /(?<A>tom|bon)-\g{A}/
110 tom-tom
111 0: tom-tom
112 1: tom
113 bon-bon
114 0: bon-bon
115 1: bon
116
117 /(^(a|b\g{-1}))/
118 bacxxx
119 No match
120
121 /(?|(abc)|(xyz))\1/
122 abcabc
123 0: abcabc
124 1: abc
125 xyzxyz
126 0: xyzxyz
127 1: xyz
128 ** Failers
129 No match
130 abcxyz
131 No match
132 xyzabc
133 No match
134
135 /(?|(abc)|(xyz))(?1)/
136 abcabc
137 0: abcabc
138 1: abc
139 xyzabc
140 0: xyzabc
141 1: xyz
142 ** Failers
143 No match
144 xyzxyz
145 No match
146
147 /^X(?5)(a)(?|(b)|(q))(c)(d)(Y)/
148 XYabcdY
149 0: XYabcdY
150 1: a
151 2: b
152 3: c
153 4: d
154 5: Y
155
156 /^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)/
157 XYabcdY
158 0: XYabcdY
159 1: a
160 2: b
161 3: <unset>
162 4: <unset>
163 5: c
164 6: d
165 7: Y
166
167 /^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/
168 XYabcdY
169 0: XYabcdY
170 1: a
171 2: b
172 3: <unset>
173 4: <unset>
174 5: c
175 6: d
176 7: Y
177
178 /(?'abc'\w+):\k<abc>{2}/
179 a:aaxyz
180 0: a:aa
181 1: a
182 ab:ababxyz
183 0: ab:abab
184 1: ab
185 ** Failers
186 No match
187 a:axyz
188 No match
189 ab:abxyz
190 No match
191
192 /(?'abc'\w+):\g{abc}{2}/
193 a:aaxyz
194 0: a:aa
195 1: a
196 ab:ababxyz
197 0: ab:abab
198 1: ab
199 ** Failers
200 No match
201 a:axyz
202 No match
203 ab:abxyz
204 No match
205
206 /^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)/x
207 abd
208 0: abd
209 1: a
210 ce
211 0: ce
212
213 /^(a.)\g-1Z/
214 aXaXZ
215 0: aXaXZ
216 1: aX
217
218 /^(a.)\g{-1}Z/
219 aXaXZ
220 0: aXaXZ
221 1: aX
222
223 /^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) /x
224 abcd
225 0: ab
226
227 /(?<NAME>(?&NAME_PAT))\s+(?<ADDR>(?&ADDRESS_PAT))
228 (?(DEFINE)
229 (?<NAME_PAT>[a-z]+)
230 (?<ADDRESS_PAT>\d+)
231 )/x
232 metcalfe 33
233 0: metcalfe 33
234 1: metcalfe
235 2: 33
236
237 /(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))\b(?&byte)(\.(?&byte)){3}/
238 1.2.3.4
239 0: 1.2.3.4
240 1: <unset>
241 2: .4
242 131.111.10.206
243 0: 131.111.10.206
244 1: <unset>
245 2: .206
246 10.0.0.0
247 0: 10.0.0.0
248 1: <unset>
249 2: .0
250 ** Failers
251 No match
252 10.6
253 No match
254 455.3.4.5
255 No match
256
257 /\b(?&byte)(\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\d|25[0-5]|1\d\d|[1-9]?\d))/
258 1.2.3.4
259 0: 1.2.3.4
260 1: .4
261 131.111.10.206
262 0: 131.111.10.206
263 1: .206
264 10.0.0.0
265 0: 10.0.0.0
266 1: .0
267 ** Failers
268 No match
269 10.6
270 No match
271 455.3.4.5
272 No match
273
274 /^(\w++|\s++)*$/
275 now is the time for all good men to come to the aid of the party
276 0: now is the time for all good men to come to the aid of the party
277 1: party
278 *** Failers
279 No match
280 this is not a line with only words and spaces!
281 No match
282
283 /(\d++)(\w)/
284 12345a
285 0: 12345a
286 1: 12345
287 2: a
288 *** Failers
289 No match
290 12345+
291 No match
292
293 /a++b/
294 aaab
295 0: aaab
296
297 /(a++b)/
298 aaab
299 0: aaab
300 1: aaab
301
302 /(a++)b/
303 aaab
304 0: aaab
305 1: aaa
306
307 /([^()]++|\([^()]*\))+/
308 ((abc(ade)ufh()()x
309 0: abc(ade)ufh()()x
310 1: x
311
312 /\(([^()]++|\([^()]+\))+\)/
313 (abc)
314 0: (abc)
315 1: abc
316 (abc(def)xyz)
317 0: (abc(def)xyz)
318 1: xyz
319 *** Failers
320 No match
321 ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
322 No match
323
324 /^([^()]|\((?1)*\))*$/
325 abc
326 0: abc
327 1: c
328 a(b)c
329 0: a(b)c
330 1: c
331 a(b(c))d
332 0: a(b(c))d
333 1: d
334 *** Failers)
335 No match
336 a(b(c)d
337 No match
338
339 /^>abc>([^()]|\((?1)*\))*<xyz<$/
340 >abc>123<xyz<
341 0: >abc>123<xyz<
342 1: 3
343 >abc>1(2)3<xyz<
344 0: >abc>1(2)3<xyz<
345 1: 3
346 >abc>(1(2)3)<xyz<
347 0: >abc>(1(2)3)<xyz<
348 1: (1(2)3)
349
350 /^(?:((.)(?1)\2|)|((.)(?3)\4|.))$/i
351 1221
352 0: 1221
353 1: 1221
354 2: 1
355 Satanoscillatemymetallicsonatas
356 0: Satanoscillatemymetallicsonatas
357 1: <unset>
358 2: <unset>
359 3: Satanoscillatemymetallicsonatas
360 4: S
361 AmanaplanacanalPanama
362 0: AmanaplanacanalPanama
363 1: <unset>
364 2: <unset>
365 3: AmanaplanacanalPanama
366 4: A
367 AblewasIereIsawElba
368 0: AblewasIereIsawElba
369 1: <unset>
370 2: <unset>
371 3: AblewasIereIsawElba
372 4: A
373 *** Failers
374 No match
375 Thequickbrownfox
376 No match
377
378 /^(\d+|\((?1)([+*-])(?1)\)|-(?1))$/
379 12
380 0: 12
381 1: 12
382 (((2+2)*-3)-7)
383 0: (((2+2)*-3)-7)
384 1: (((2+2)*-3)-7)
385 2: -
386 -12
387 0: -12
388 1: -12
389 *** Failers
390 No match
391 ((2+2)*-3)-7)
392 No match
393
394 /^(x(y|(?1){2})z)/
395 xyz
396 0: xyz
397 1: xyz
398 2: y
399 xxyzxyzz
400 0: xxyzxyzz
401 1: xxyzxyzz
402 2: xyzxyz
403 *** Failers
404 No match
405 xxyzz
406 No match
407 xxyzxyzxyzz
408 No match
409
410 /((< (?: (?(R) \d++ | [^<>]*+) | (?2)) * >))/x
411 <>
412 0: <>
413 1: <>
414 2: <>
415 <abcd>
416 0: <abcd>
417 1: <abcd>
418 2: <abcd>
419 <abc <123> hij>
420 0: <abc <123> hij>
421 1: <abc <123> hij>
422 2: <abc <123> hij>
423 <abc <def> hij>
424 0: <def>
425 1: <def>
426 2: <def>
427 <abc<>def>
428 0: <abc<>def>
429 1: <abc<>def>
430 2: <abc<>def>
431 <abc<>
432 0: <>
433 1: <>
434 2: <>
435 *** Failers
436 No match
437 <abc
438 No match
439
440 /^a+(*FAIL)/
441 aaaaaa
442 No match
443
444 /a+b?c+(*FAIL)/
445 aaabccc
446 No match
447
448 /a+b?(*PRUNE)c+(*FAIL)/
449 aaabccc
450 No match
451
452 /a+b?(*COMMIT)c+(*FAIL)/
453 aaabccc
454 No match
455
456 /a+b?(*SKIP)c+(*FAIL)/
457 aaabcccaaabccc
458 No match
459
460 /^(?:aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
461 aaaxxxxxx
462 0: aaaxxxxxx
463 aaa++++++
464 0: aaa
465 bbbxxxxx
466 0: bbbxxxxx
467 bbb+++++
468 0: bbb
469 cccxxxx
470 0: cccxxxx
471 ccc++++
472 0: ccc
473 dddddddd
474 0: ddd
475
476 /^(aaa(*THEN)\w{6}|bbb(*THEN)\w{5}|ccc(*THEN)\w{4}|\w{3})/
477 aaaxxxxxx
478 0: aaaxxxxxx
479 1: aaaxxxxxx
480 aaa++++++
481 0: aaa
482 1: aaa
483 bbbxxxxx
484 0: bbbxxxxx
485 1: bbbxxxxx
486 bbb+++++
487 0: bbb
488 1: bbb
489 cccxxxx
490 0: cccxxxx
491 1: cccxxxx
492 ccc++++
493 0: ccc
494 1: ccc
495 dddddddd
496 0: ddd
497 1: ddd
498
499 /a+b?(*THEN)c+(*FAIL)/
500 aaabccc
501 No match
502
503 /(A (A|B(*ACCEPT)|C) D)(E)/x
504 ABX
505 0: AB
506 1: AB
507 2: B
508 AADE
509 0: AADE
510 1: AAD
511 2: A
512 3: E
513 ACDE
514 0: ACDE
515 1: ACD
516 2: C
517 3: E
518 ** Failers
519 No match
520 AD
521 No match
522
523 /^\W*+(?:((.)\W*+(?1)\W*+\2|)|((.)\W*+(?3)\W*+\4|\W*+.\W*+))\W*+$/i
524 1221
525 0: 1221
526 1: 1221
527 2: 1
528 Satan, oscillate my metallic sonatas!
529 0: Satan, oscillate my metallic sonatas!
530 1: <unset>
531 2: <unset>
532 3: Satan, oscillate my metallic sonatas
533 4: S
534 A man, a plan, a canal: Panama!
535 0: A man, a plan, a canal: Panama!
536 1: <unset>
537 2: <unset>
538 3: A man, a plan, a canal: Panama
539 4: A
540 Able was I ere I saw Elba.
541 0: Able was I ere I saw Elba.
542 1: <unset>
543 2: <unset>
544 3: Able was I ere I saw Elba
545 4: A
546 *** Failers
547 No match
548 The quick brown fox
549 No match
550
551 /^((.)(?1)\2|.)$/
552 a
553 0: a
554 1: a
555 aba
556 0: aba
557 1: aba
558 2: a
559 aabaa
560 0: aabaa
561 1: aabaa
562 2: a
563 abcdcba
564 0: abcdcba
565 1: abcdcba
566 2: a
567 pqaabaaqp
568 0: pqaabaaqp
569 1: pqaabaaqp
570 2: p
571 ablewasiereisawelba
572 0: ablewasiereisawelba
573 1: ablewasiereisawelba
574 2: a
575 rhubarb
576 No match
577 the quick brown fox
578 No match
579
580 /(a)(?<=b(?1))/
581 baz
582 0: a
583 1: a
584 ** Failers
585 No match
586 caz
587 No match
588
589 /(?<=b(?1))(a)/
590 zbaaz
591 0: a
592 1: a
593 ** Failers
594 No match
595 aaa
596 No match
597
598 /(?<X>a)(?<=b(?&X))/
599 baz
600 0: a
601 1: a
602
603 /-- End of testinput11 --/

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12