1 |
Testing Perl-Compatible Regular Expressions |
PCRE version 2.00 24-Sep-1998 |
|
PCRE version 1.01 19-Nov-1997 |
|
2 |
|
|
3 |
/the quick brown fox/ |
/the quick brown fox/ |
4 |
the quick brown fox |
the quick brown fox |
1983 |
/\Aabc\Z/m |
/\Aabc\Z/m |
1984 |
abc |
abc |
1985 |
0: abc |
0: abc |
1986 |
|
abc\n |
1987 |
|
0: abc |
1988 |
*** Failers |
*** Failers |
1989 |
No match |
No match |
1990 |
qqq\nabc |
qqq\nabc |
1993 |
No match |
No match |
1994 |
qqq\nabc\nzzz |
qqq\nabc\nzzz |
1995 |
No match |
No match |
1996 |
|
|
1997 |
/\A(.)*\Z/s |
/\A(.)*\Z/s |
1998 |
abc\ndef |
abc\ndef |
1999 |
0: abc\x0adef |
0: abc\x0adef |
2079 |
0: abcABC |
0: abcABC |
2080 |
1: abc |
1: abc |
2081 |
|
|
2082 |
/(main(OPT)?)+/ |
/(main(O)?)+/ |
2083 |
mainmain |
mainmain |
2084 |
0: mainmain |
0: mainmain |
2085 |
1: main |
1: main |
2086 |
mainOPTmain |
mainOmain |
2087 |
0: mainOPTmain |
0: mainOmain |
2088 |
1: main |
1: main |
2089 |
2: OPT |
2: O |
2090 |
|
|
2091 |
/ab{3cd/ |
/ab{3cd/ |
2092 |
ab{3cd |
ab{3cd |
2166 |
1: abc |
1: abc |
2167 |
|
|
2168 |
/abc\81/ |
/abc\81/ |
2169 |
abc\081 |
abc\081 |
2170 |
0: abc\x0081 |
0: abc\x0081 |
2171 |
abc\0\x38\x31 |
abc\0\x38\x31 |
2172 |
0: abc\x0081 |
0: abc\x0081 |
2173 |
|
|
2174 |
/abc\91/ |
/abc\91/ |
2175 |
abc\091 |
abc\091 |
2176 |
0: abc\x0091 |
0: abc\x0091 |
2177 |
abc\0\x39\x31 |
abc\0\x39\x31 |
2178 |
0: abc\x0091 |
0: abc\x0091 |
2179 |
|
|
2180 |
/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/ |
/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/ |
2276 |
No match |
No match |
2277 |
|
|
2278 |
/[^a]/ |
/[^a]/ |
2279 |
Abc |
Abc |
2280 |
0: A |
0: A |
2281 |
|
|
2282 |
/[^a]/i |
/[^a]/i |
2283 |
Abc |
Abc |
2284 |
0: b |
0: b |
2285 |
|
|
2286 |
/[^a]+/ |
/[^a]+/ |
2287 |
AAAaAbc |
AAAaAbc |
2288 |
0: AAA |
0: AAA |
2289 |
|
|
2290 |
/[^a]+/i |
/[^a]+/i |
2291 |
AAAaAbc |
AAAaAbc |
2292 |
0: bc |
0: bc |
2293 |
|
|
2294 |
/[^a]+/ |
/[^a]+/ |
2295 |
bbb\nccc |
bbb\nccc |
2296 |
0: bbb\x0accc |
0: bbb\x0accc |
2297 |
|
|
2298 |
|
/[^k]$/ |
2299 |
|
abc |
2300 |
|
0: c |
2301 |
|
*** Failers |
2302 |
|
0: s |
2303 |
|
abk |
2304 |
|
No match |
2305 |
|
|
2306 |
|
/[^k]{2,3}$/ |
2307 |
|
abc |
2308 |
|
0: abc |
2309 |
|
kbc |
2310 |
|
0: bc |
2311 |
|
kabc |
2312 |
|
0: abc |
2313 |
|
*** Failers |
2314 |
|
0: ers |
2315 |
|
abk |
2316 |
|
No match |
2317 |
|
akb |
2318 |
|
No match |
2319 |
|
akk |
2320 |
|
No match |
2321 |
|
|
2322 |
|
/^\d{8,}\@.+[^k]$/ |
2323 |
|
12345678\@a.b.c.d |
2324 |
|
0: 12345678@a.b.c.d |
2325 |
|
123456789\@x.y.z |
2326 |
|
0: 123456789@x.y.z |
2327 |
|
*** Failers |
2328 |
|
No match |
2329 |
|
12345678\@x.y.uk |
2330 |
|
No match |
2331 |
|
1234567\@a.b.c.d |
2332 |
|
No match |
2333 |
|
|
2334 |
|
/(a)\1{8,}/ |
2335 |
|
aaaaaaaaa |
2336 |
|
0: aaaaaaaaa |
2337 |
|
1: a |
2338 |
|
aaaaaaaaaa |
2339 |
|
0: aaaaaaaaaa |
2340 |
|
1: a |
2341 |
|
*** Failers |
2342 |
|
No match |
2343 |
|
aaaaaaa |
2344 |
|
No match |
2345 |
|
|
2346 |
|
/[^a]/ |
2347 |
|
aaaabcd |
2348 |
|
0: b |
2349 |
|
aaAabcd |
2350 |
|
0: A |
2351 |
|
|
2352 |
|
/[^a]/i |
2353 |
|
aaaabcd |
2354 |
|
0: b |
2355 |
|
aaAabcd |
2356 |
|
0: b |
2357 |
|
|
2358 |
|
/[^az]/ |
2359 |
|
aaaabcd |
2360 |
|
0: b |
2361 |
|
aaAabcd |
2362 |
|
0: A |
2363 |
|
|
2364 |
|
/[^az]/i |
2365 |
|
aaaabcd |
2366 |
|
0: b |
2367 |
|
aaAabcd |
2368 |
|
0: b |
2369 |
|
|
2370 |
|
/\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377/ |
2371 |
|
\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\042\043\044\045\046\047\050\051\052\053\054\055\056\057\060\061\062\063\064\065\066\067\070\071\072\073\074\075\076\077\100\101\102\103\104\105\106\107\110\111\112\113\114\115\116\117\120\121\122\123\124\125\126\127\130\131\132\133\134\135\136\137\140\141\142\143\144\145\146\147\150\151\152\153\154\155\156\157\160\161\162\163\164\165\166\167\170\171\172\173\174\175\176\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377 |
2372 |
|
0: \x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff |
2373 |
|
|
2374 |
|
/P[^*]TAIRE[^*]{1,6}?LL/ |
2375 |
|
xxxxxxxxxxxPSTAIREISLLxxxxxxxxx |
2376 |
|
0: PSTAIREISLL |
2377 |
|
|
2378 |
|
/P[^*]TAIRE[^*]{1,}?LL/ |
2379 |
|
xxxxxxxxxxxPSTAIREISLLxxxxxxxxx |
2380 |
|
0: PSTAIREISLL |
2381 |
|
|
2382 |
|
/(\.\d\d[1-9]?)\d+/ |
2383 |
|
1.230003938 |
2384 |
|
0: .230003938 |
2385 |
|
1: .23 |
2386 |
|
1.875000282 |
2387 |
|
0: .875000282 |
2388 |
|
1: .875 |
2389 |
|
1.235 |
2390 |
|
0: .235 |
2391 |
|
1: .23 |
2392 |
|
|
2393 |
|
/(\.\d\d((?=0)|\d(?=\d)))/ |
2394 |
|
1.230003938 |
2395 |
|
0: .23 |
2396 |
|
1: .23 |
2397 |
|
2: |
2398 |
|
1.875000282 |
2399 |
|
0: .875 |
2400 |
|
1: .875 |
2401 |
|
2: 5 |
2402 |
|
*** Failers |
2403 |
|
No match |
2404 |
|
1.235 |
2405 |
|
No match |
2406 |
|
|
2407 |
|
/a(?)b/ |
2408 |
|
ab |
2409 |
|
0: ab |
2410 |
|
|
2411 |
|
/\b(foo)\s+(\w+)/i |
2412 |
|
Food is on the foo table |
2413 |
|
0: foo table |
2414 |
|
1: foo |
2415 |
|
2: table |
2416 |
|
|
2417 |
|
/foo(.*)bar/ |
2418 |
|
The food is under the bar in the barn. |
2419 |
|
0: food is under the bar in the bar |
2420 |
|
1: d is under the bar in the |
2421 |
|
|
2422 |
|
/foo(.*?)bar/ |
2423 |
|
The food is under the bar in the barn. |
2424 |
|
0: food is under the bar |
2425 |
|
1: d is under the |
2426 |
|
|
2427 |
|
/(.*)(\d*)/ |
2428 |
|
I have 2 numbers: 53147 |
2429 |
|
0: I have 2 numbers: 53147 |
2430 |
|
1: I have 2 numbers: 53147 |
2431 |
|
2: |
2432 |
|
|
2433 |
|
/(.*)(\d+)/ |
2434 |
|
I have 2 numbers: 53147 |
2435 |
|
0: I have 2 numbers: 53147 |
2436 |
|
1: I have 2 numbers: 5314 |
2437 |
|
2: 7 |
2438 |
|
|
2439 |
|
/(.*?)(\d*)/ |
2440 |
|
I have 2 numbers: 53147 |
2441 |
|
0: |
2442 |
|
1: |
2443 |
|
2: |
2444 |
|
|
2445 |
|
/(.*?)(\d+)/ |
2446 |
|
I have 2 numbers: 53147 |
2447 |
|
0: I have 2 |
2448 |
|
1: I have |
2449 |
|
2: 2 |
2450 |
|
|
2451 |
|
/(.*)(\d+)$/ |
2452 |
|
I have 2 numbers: 53147 |
2453 |
|
0: I have 2 numbers: 53147 |
2454 |
|
1: I have 2 numbers: 5314 |
2455 |
|
2: 7 |
2456 |
|
|
2457 |
|
/(.*?)(\d+)$/ |
2458 |
|
I have 2 numbers: 53147 |
2459 |
|
0: I have 2 numbers: 53147 |
2460 |
|
1: I have 2 numbers: |
2461 |
|
2: 53147 |
2462 |
|
|
2463 |
|
/(.*)\b(\d+)$/ |
2464 |
|
I have 2 numbers: 53147 |
2465 |
|
0: I have 2 numbers: 53147 |
2466 |
|
1: I have 2 numbers: |
2467 |
|
2: 53147 |
2468 |
|
|
2469 |
|
/(.*\D)(\d+)$/ |
2470 |
|
I have 2 numbers: 53147 |
2471 |
|
0: I have 2 numbers: 53147 |
2472 |
|
1: I have 2 numbers: |
2473 |
|
2: 53147 |
2474 |
|
|
2475 |
|
/^\D*(?!123)/ |
2476 |
|
ABC123 |
2477 |
|
0: AB |
2478 |
|
|
2479 |
|
/^(\D*)(?=\d)(?!123)/ |
2480 |
|
ABC445 |
2481 |
|
0: ABC |
2482 |
|
1: ABC |
2483 |
|
*** Failers |
2484 |
|
No match |
2485 |
|
ABC123 |
2486 |
|
No match |
2487 |
|
|
2488 |
/ End of test input / |
/ End of test input / |
2489 |
|
|