version 1.1.1.2, 2012/02/21 23:50:25
|
version 1.1.1.4, 2013/07/22 08:25:57
|
Line 6160 No match
|
Line 6160 No match
|
1: bc |
1: bc |
2: bc |
2: bc |
|
|
/-- This tests for an IPv6 address in the form where it can have up to --/ | /-- This tests for an IPv6 address in the form where it can have up to |
/-- eight components, one and only one of which is empty. This must be --/ | eight components, one and only one of which is empty. This must be |
No match | an internal component. --/ |
/-- an internal component. --/ | |
No match | |
|
|
/^(?!:) # colon disallowed at start |
/^(?!:) # colon disallowed at start |
(?: # start of item |
(?: # start of item |
Line 7770 No match
|
Line 7768 No match
|
1: (ab(cd)ef) |
1: (ab(cd)ef) |
2: ef |
2: ef |
|
|
/^(?!a(*SKIP)b)/ |
|
ac |
|
0: |
|
|
|
/^(?=a(*SKIP)b|ac)/ |
/^(?=a(*SKIP)b|ac)/ |
** Failers |
** Failers |
No match |
No match |
ac |
ac |
No match |
No match |
|
|
/^(?=a(*THEN)b|ac)/ |
|
ac |
|
0: |
|
|
|
/^(?=a(*PRUNE)b)/ |
/^(?=a(*PRUNE)b)/ |
ab |
ab |
0: |
0: |
Line 7796 No match
|
Line 7786 No match
|
ac |
ac |
0: |
0: |
|
|
/^(?(?!a(*SKIP)b))/ |
|
ac |
|
0: |
|
|
|
/(?>a\Kb)/ |
/(?>a\Kb)/ |
ab |
ab |
0: b |
0: b |
Line 8169 No match
|
Line 8155 No match
|
1: AB |
1: AB |
2: B |
2: B |
|
|
/\A.*?(?:a|b(*THEN)c)/ |
|
ba |
|
0: ba |
|
|
|
/\A.*?(?:a|bc)/ |
|
ba |
|
0: ba |
|
|
|
/\A.*?(a|b(*THEN)c)/ |
|
ba |
|
0: ba |
|
1: a |
|
|
|
/\A.*?(a|bc)/ |
/\A.*?(a|bc)/ |
ba |
ba |
0: ba |
0: ba |
1: a |
1: a |
|
|
/\A.*?(?:a|b(*THEN)c)++/ |
|
ba |
|
0: ba |
|
|
|
/\A.*?(?:a|bc)++/ |
/\A.*?(?:a|bc)++/ |
ba |
ba |
0: ba |
0: ba |
|
|
/\A.*?(a|b(*THEN)c)++/ |
|
ba |
|
0: ba |
|
1: a |
|
|
|
/\A.*?(a|bc)++/ |
/\A.*?(a|bc)++/ |
ba |
ba |
0: ba |
0: ba |
1: a |
1: a |
|
|
/\A.*?(?:a|b(*THEN)c|d)/ |
|
ba |
|
0: ba |
|
|
|
/\A.*?(?:a|bc|d)/ |
/\A.*?(?:a|bc|d)/ |
ba |
ba |
0: ba |
0: ba |
Line 8713 No match
|
Line 8673 No match
|
|
|
/(another)?(\1+)test/ |
/(another)?(\1+)test/ |
hello world test |
hello world test |
|
No match |
|
|
|
/(a(*COMMIT)b){0}a(?1)|aac/ |
|
aac |
|
0: aac |
|
|
|
/((?:a?)*)*c/ |
|
aac |
|
0: aac |
|
1: |
|
|
|
/((?>a?)*)*c/ |
|
aac |
|
0: aac |
|
1: |
|
|
|
/(?>.*?a)(?<=ba)/ |
|
aba |
|
0: ba |
|
|
|
/(?:.*?a)(?<=ba)/ |
|
aba |
|
0: aba |
|
|
|
/.*?a(*PRUNE)b/ |
|
aab |
|
0: ab |
|
|
|
/.*?a(*PRUNE)b/s |
|
aab |
|
0: ab |
|
|
|
/^a(*PRUNE)b/s |
|
aab |
|
No match |
|
|
|
/.*?a(*SKIP)b/ |
|
aab |
|
0: ab |
|
|
|
/(?>.*?a)b/s |
|
aab |
|
0: ab |
|
|
|
/(?>.*?a)b/ |
|
aab |
|
0: ab |
|
|
|
/(?>^a)b/s |
|
aab |
|
No match |
|
|
|
/(?>.*?)(?<=(abcd)|(wxyz))/ |
|
alphabetabcd |
|
0: |
|
1: abcd |
|
endingwxyz |
|
0: |
|
1: <unset> |
|
2: wxyz |
|
|
|
/(?>.*)(?<=(abcd)|(wxyz))/ |
|
alphabetabcd |
|
0: alphabetabcd |
|
1: abcd |
|
endingwxyz |
|
0: endingwxyz |
|
1: <unset> |
|
2: wxyz |
|
|
|
"(?>.*)foo" |
|
abcdfooxyz |
|
No match |
|
|
|
"(?>.*?)foo" |
|
abcdfooxyz |
|
0: foo |
|
|
|
/(?:(a(*PRUNE)b)){0}(?:(?1)|ac)/ |
|
ac |
|
0: ac |
|
|
|
/(?:(a(*SKIP)b)){0}(?:(?1)|ac)/ |
|
ac |
|
0: ac |
|
|
|
/(?<=(*SKIP)ac)a/ |
|
aa |
|
No match |
|
|
|
/A(*MARK:A)A+(*SKIP:B)(B|Z) | AC/xK |
|
AAAC |
|
0: AC |
|
|
|
/a(*SKIP:m)x|ac(*:n)(*SKIP:n)d|ac/K |
|
acacd |
|
0: acd |
|
MK: n |
|
|
|
/A(*SKIP:m)x|A(*SKIP:n)x|AB/K |
|
AB |
|
0: AB |
|
|
|
/((*SKIP:r)d){0}a(*SKIP:m)x|ac(*:n)|ac/K |
|
acacd |
|
0: ac |
|
MK: n |
|
|
|
/-- Tests that try to figure out how Perl works. My hypothesis is that the |
|
first verb that is backtracked onto is the one that acts. This seems to be |
|
the case almost all the time, but there is one exception that is perhaps a |
|
bug. --/ |
|
|
|
/-- This matches "aaaac"; each PRUNE advances one character until the subject |
|
no longer starts with 5 'a's. --/ |
|
|
|
/aaaaa(*PRUNE)b|a+c/ |
|
aaaaaac |
|
0: aaaac |
|
|
|
/-- Putting SKIP in front of PRUNE makes no difference, as it is never |
|
backtracked onto, whether or not it has a label. --/ |
|
|
|
/aaaaa(*SKIP)(*PRUNE)b|a+c/ |
|
aaaaaac |
|
0: aaaac |
|
|
|
/aaaaa(*SKIP:N)(*PRUNE)b|a+c/ |
|
aaaaaac |
|
0: aaaac |
|
|
|
/aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c/ |
|
aaaaaac |
|
0: aaaac |
|
|
|
/-- Putting THEN in front makes no difference. */ |
|
|
|
/aaaaa(*THEN)(*PRUNE)b|a+c/ |
|
aaaaaac |
|
0: aaaac |
|
|
|
/-- However, putting COMMIT in front of the prune changes it to "no match". I |
|
think this is inconsistent and possibly a bug. For the moment, running this |
|
test is moved out of the Perl-compatible file. --/ |
|
|
|
/aaaaa(*COMMIT)(*PRUNE)b|a+c/ |
|
|
|
|
|
/---- OK, lets play the same game again using SKIP instead of PRUNE. ----/ |
|
|
|
/-- This matches "ac" because SKIP forces the next match to start on the |
|
sixth "a". --/ |
|
|
|
/aaaaa(*SKIP)b|a+c/ |
|
aaaaaac |
|
0: ac |
|
|
|
/-- Putting PRUNE in front makes no difference. --/ |
|
|
|
/aaaaa(*PRUNE)(*SKIP)b|a+c/ |
|
aaaaaac |
|
0: ac |
|
|
|
/-- Putting THEN in front makes no difference. --/ |
|
|
|
/aaaaa(*THEN)(*SKIP)b|a+c/ |
|
aaaaaac |
|
0: ac |
|
|
|
/-- In this case, neither does COMMIT. This still matches "ac". --/ |
|
|
|
/aaaaa(*COMMIT)(*SKIP)b|a+c/ |
|
aaaaaac |
|
0: ac |
|
|
|
/-- This gives "no match", as expected. --/ |
|
|
|
/aaaaa(*COMMIT)b|a+c/ |
|
aaaaaac |
|
No match |
|
|
|
|
|
/------ Tests using THEN ------/ |
|
|
|
/-- This matches "aaaaaac", as expected. --/ |
|
|
|
/aaaaa(*THEN)b|a+c/ |
|
aaaaaac |
|
0: aaaaaac |
|
|
|
/-- Putting SKIP in front makes no difference. --/ |
|
|
|
/aaaaa(*SKIP)(*THEN)b|a+c/ |
|
aaaaaac |
|
0: aaaaaac |
|
|
|
/-- Putting PRUNE in front makes no difference. --/ |
|
|
|
/aaaaa(*PRUNE)(*THEN)b|a+c/ |
|
aaaaaac |
|
0: aaaaaac |
|
|
|
/-- Putting COMMIT in front makes no difference. --/ |
|
|
|
/aaaaa(*COMMIT)(*THEN)b|a+c/ |
|
aaaaaac |
|
0: aaaaaac |
|
|
|
/-- End of "priority" tests --/ |
|
|
|
/aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+/ |
|
aaaaaa |
|
0: a |
|
|
|
/aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/ |
|
aaaaaa |
|
0: a |
|
|
|
/aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+/ |
|
aaaaaa |
|
0: aaaa |
|
|
|
/aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+/ |
|
aaaaaa |
|
0: a |
|
|
|
/a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c/ |
|
aaaac |
|
0: aac |
|
|
|
/a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c/ |
|
aaaac |
|
0: ac |
|
|
|
/aaa(*PRUNE:A)a(*SKIP:A)b|a+c/ |
|
aaaac |
|
0: aac |
|
|
|
/aaa(*MARK:A)a(*SKIP:A)b|a+c/ |
|
aaaac |
|
0: ac |
|
|
|
/a(*:m)a(*COMMIT)(*SKIP:m)b|a+c/K |
|
aaaaaac |
|
0: ac |
|
|
|
/.?(a|b(*THEN)c)/ |
|
ba |
|
0: ba |
|
1: a |
|
|
|
/(a(*COMMIT)b)c|abd/ |
|
abc |
|
0: abc |
|
1: ab |
|
abd |
|
No match |
|
|
|
/(?=a(*COMMIT)b)abc|abd/ |
|
abc |
|
0: abc |
|
abd |
|
0: abd |
|
|
|
/(?>a(*COMMIT)b)c|abd/ |
|
abc |
|
0: abc |
|
abd |
|
0: abd |
|
|
|
/a(?=b(*COMMIT)c)[^d]|abd/ |
|
abd |
|
No match |
|
abc |
|
0: ab |
|
|
|
/a(?=bc).|abd/ |
|
abd |
|
0: abd |
|
abc |
|
0: ab |
|
|
|
/a(?>b(*COMMIT)c)d|abd/ |
|
abceabd |
|
No match |
|
|
|
/a(?>bc)d|abd/ |
|
abceabd |
|
0: abd |
|
|
|
/(?>a(*COMMIT)b)c|abd/ |
|
abd |
|
0: abd |
|
|
|
/(?>a(*COMMIT)c)d|abd/ |
|
abd |
|
No match |
|
|
|
/((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))/ |
|
ac |
|
0: ac |
|
1: <unset> |
|
2: c |
|
|
|
/-- These tests were formerly in test 2, but changes in PCRE and Perl have |
|
made them compatible. --/ |
|
|
|
/^(a)?(?(1)a|b)+$/ |
|
*** Failers |
|
No match |
|
a |
|
No match |
|
|
|
/(?=a\Kb)ab/ |
|
ab |
|
0: b |
|
|
|
/(?!a\Kb)ac/ |
|
ac |
|
0: ac |
|
|
|
/^abc(?<=b\Kc)d/ |
|
abcd |
|
0: cd |
|
|
|
/^abc(?<!b\Kq)d/ |
|
abcd |
|
0: abcd |
|
|
|
|
|
/A(*PRUNE:A)A+(*SKIP:A)(B|Z) | AC/xK |
|
AAAC |
|
No match, mark = A |
|
|
|
/^((abc|abcx)(*THEN)y|abcd)/ |
|
abcd |
|
0: abcd |
|
1: abcd |
|
*** Failers |
|
No match |
|
abcxy |
|
No match |
|
|
|
/^((yes|no)(*THEN)(*F))?/ |
|
yes |
|
No match |
|
|
|
/(A (.*) C? (*THEN) | A D) (*FAIL)/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) C? (*THEN) | A D) z/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) C? (*THEN) | A D) \s* (*FAIL)/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) C? (*THEN) | A D) \s* z/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) (?:C|) (*THEN) | A D) (*FAIL)/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) (?:C|) (*THEN) | A D) z/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) C{0,6} (*THEN) | A D) (*FAIL)/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) C{0,6} (*THEN) | A D) z/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) (CE){0,6} (*THEN) | A D) (*FAIL)/x |
|
AbcdCEBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) (CE){0,6} (*THEN) | A D) z/x |
|
AbcdCEBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) (CE*){0,6} (*THEN) | A D) (*FAIL)/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(A (.*) (CE*){0,6} (*THEN) | A D) z/x |
|
AbcdCBefgBhiBqz |
|
No match |
|
|
|
/(?=a(*COMMIT)b|ac)ac|ac/ |
|
ac |
|
No match |
|
|
|
/(?=a(*COMMIT)b|(ac)) ac | (a)c/x |
|
ac |
|
No match |
|
|
|
/--------/ |
|
|
|
/(?(?!b(*THEN)a)bn|bnn)/ |
|
bnn |
|
0: bn |
|
|
|
/(?!b(*SKIP)a)bn|bnn/ |
|
bnn |
|
0: bn |
|
|
|
/(?(?!b(*SKIP)a)bn|bnn)/ |
|
bnn |
|
0: bn |
|
|
|
/(?!b(*PRUNE)a)bn|bnn/ |
|
bnn |
|
0: bn |
|
|
|
/(?(?!b(*PRUNE)a)bn|bnn)/ |
|
bnn |
|
0: bn |
|
|
|
/(?!b(*COMMIT)a)bn|bnn/ |
|
bnn |
|
0: bn |
|
|
|
/(?(?!b(*COMMIT)a)bn|bnn)/ |
|
bnn |
|
0: bn |
|
|
|
/(?=b(*SKIP)a)bn|bnn/ |
|
bnn |
|
No match |
|
|
|
/(?=b(*THEN)a)bn|bnn/ |
|
bnn |
|
0: bnn |
|
|
|
/^(?!a(*SKIP)b)/ |
|
ac |
|
0: |
|
|
|
/^(?!a(*SKIP)b)../ |
|
acd |
|
0: ac |
|
|
|
/(?!a(*SKIP)b)../ |
|
acd |
|
0: ac |
|
|
|
/^(?(?!a(*SKIP)b))/ |
|
ac |
|
0: |
|
|
|
/^(?!a(*PRUNE)b)../ |
|
acd |
|
0: ac |
|
|
|
/(?!a(*PRUNE)b)../ |
|
acd |
|
0: ac |
|
|
|
/(?!a(*COMMIT)b)ac|cd/ |
|
ac |
|
0: ac |
|
|
|
/\A.*?(?:a|bc)/ |
|
ba |
|
0: ba |
|
|
|
/^(A(*THEN)B|C(*THEN)D)/ |
|
CD |
|
0: CD |
|
1: CD |
|
|
|
/(*:m(m)(?&y)(?(DEFINE)(?<y>b))/K |
|
abc |
|
0: b |
|
MK: m(m |
|
|
|
/(*PRUNE:m(m)(?&y)(?(DEFINE)(?<y>b))/K |
|
abc |
|
0: b |
|
MK: m(m |
|
|
|
/(*SKIP:m(m)(?&y)(?(DEFINE)(?<y>b))/K |
|
abc |
|
0: b |
|
|
|
/(*THEN:m(m)(?&y)(?(DEFINE)(?<y>b))/K |
|
abc |
|
0: b |
|
MK: m(m |
|
|
|
/^\d*\w{4}/ |
|
1234 |
|
0: 1234 |
|
123 |
|
No match |
|
|
|
/^[^b]*\w{4}/ |
|
aaaa |
|
0: aaaa |
|
aaa |
|
No match |
|
|
|
/^[^b]*\w{4}/i |
|
aaaa |
|
0: aaaa |
|
aaa |
|
No match |
|
|
|
/^a*\w{4}/ |
|
aaaa |
|
0: aaaa |
|
aaa |
|
No match |
|
|
|
/^a*\w{4}/i |
|
aaaa |
|
0: aaaa |
|
aaa |
No match |
No match |
|
|
/-- End of testinput1 --/ |
/-- End of testinput1 --/ |