annotate Lib/test/re_tests.py @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 518d4f0c8fcc
children d3f2df8c2286
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
1 #!/usr/bin/env python
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
2 # -*- mode: python -*-
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
3 # $Id$
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
4
5774
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
5 # Re test suite and benchmark suite v1.5a2
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
6
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 # The 3 possible outcomes for each pattern
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 [SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
9
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
10 # Benchmark suite (needs expansion)
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
11 #
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 # The benchmark suite does not test correctness, just speed. The
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 # first element of each tuple is the regex pattern; the second is a
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 # string to match it against. The benchmarking code will embed the
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 # second string inside several sizes of padding, to test how regex
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 # matching performs on large strings.
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
17
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 benchmarks = [
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 ('Python', 'Python'), # Simple text literal
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 ('.*Python', 'Python'), # Bad text literal
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 ('.*Python.*', 'Python'), # Worse text literal
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 ('.*(Python)', 'Python'), # Bad text literal with grouping
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
23
5774
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 ('(Python|Perl|Tcl', 'Perl'), # Alternation
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 ('(Python|Perl|Tcl)', 'Perl'), # Grouped alternation
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 ('(Python)\\1', 'PythonPython'), # Backreference
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 ('([0a-z][a-z]*,)+', 'a5,b7,c9,'), # Disable the fastmap optimization
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 ('([a-z][a-z0-9]*,)+', 'a5,b7,c9,') # A few sets
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 ]
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
30
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 # Test suite (for verifying correctness)
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 #
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 # The test suite is a list of 5- or 3-tuples. The 5 parts of a
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 # complete tuple are:
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 # element 0: a string containing the pattern
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 # 1: the string to match against the pattern
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
37 # 2: the expected result (SUCCEED, FAIL, SYNTAX_ERROR)
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 # 3: a string that will be eval()'ed to produce a test string.
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 # This is an arbitrary Python expression; the available
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
40 # variables are "found" (the whole match), and "g1", "g2", ...
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
41 # up to "g99" contain the contents of each group, or the
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
42 # string 'None' if the group wasn't given a value, or the
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
43 # string 'Error' if the group index was out of range;
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
44 # also "groups", the return value of m.group() (a tuple).
5774
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
45 # 4: The expected result of evaluating the expression.
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
46 # If the two don't match, an error is reported.
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
47 #
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
48 # If the regex isn't expected to work, the latter two elements can be omitted.
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
49
3ef2563e83ee test suite for re.py
Guido van Rossum <guido@python.org>
parents:
diff changeset
50 tests = [
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
51 ('abc', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
52 ('abc', 'xbc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
53 ('abc', 'axc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
54 ('abc', 'abx', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
55 ('abc', 'xabcy', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
56 ('abc', 'ababc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
57 ('ab*c', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
58 ('ab*bc', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
59 ('ab*bc', 'abbc', SUCCEED, 'found', 'abbc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
60 ('ab*bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
61 ('ab+bc', 'abbc', SUCCEED, 'found', 'abbc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
62 ('ab+bc', 'abc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
63 ('ab+bc', 'abq', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
64 ('ab+bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
65 ('ab?bc', 'abbc', SUCCEED, 'found', 'abbc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
66 ('ab?bc', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
67 ('ab?bc', 'abbbbc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
68 ('ab?c', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
69 ('^abc$', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
70 ('^abc$', 'abcc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
71 ('^abc', 'abcc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
72 ('^abc$', 'aabc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
73 ('abc$', 'aabc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
74 ('^', 'abc', SUCCEED, 'found+"-"', '-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
75 ('$', 'abc', SUCCEED, 'found+"-"', '-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
76 ('a.c', 'abc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
77 ('a.c', 'axc', SUCCEED, 'found', 'axc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
78 ('a.*c', 'axyzc', SUCCEED, 'found', 'axyzc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
79 ('a.*c', 'axyzd', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
80 ('a[bc]d', 'abc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
81 ('a[bc]d', 'abd', SUCCEED, 'found', 'abd'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
82 ('a[b-d]e', 'abd', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
83 ('a[b-d]e', 'ace', SUCCEED, 'found', 'ace'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
84 ('a[b-d]', 'aac', SUCCEED, 'found', 'ac'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
85 ('a[-b]', 'a-', SUCCEED, 'found', 'a-'),
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
86 ('a[\\-b]', 'a-', SUCCEED, 'found', 'a-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
87 ('a[b-]', 'a-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
88 ('a[]b', '-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
89 ('a[', '-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
90 ('a\\', '-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
91 ('abc)', '-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
92 ('(abc', '-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
93 ('a]', 'a]', SUCCEED, 'found', 'a]'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
94 ('a[]]b', 'a]b', SUCCEED, 'found', 'a]b'),
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
95 ('a[\]]b', 'a]b', SUCCEED, 'found', 'a]b'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
96 ('a[^bc]d', 'aed', SUCCEED, 'found', 'aed'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
97 ('a[^bc]d', 'abd', FAIL),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
98 ('a[^-b]c', 'adc', SUCCEED, 'found', 'adc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
99 ('a[^-b]c', 'a-c', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
100 ('a[^]b]c', 'a]c', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
101 ('a[^]b]c', 'adc', SUCCEED, 'found', 'adc'),
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
102 ('\\ba\\b', 'a-', SUCCEED, '"-"', '-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
103 ('\\ba\\b', '-a', SUCCEED, '"-"', '-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
104 ('\\ba\\b', '-a-', SUCCEED, '"-"', '-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
105 ('\\by\\b', 'xy', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
106 ('\\by\\b', 'yz', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
107 ('\\by\\b', 'xyz', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
108 ('ab|cd', 'abc', SUCCEED, 'found', 'ab'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
109 ('ab|cd', 'abcd', SUCCEED, 'found', 'ab'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
110 ('()ef', 'def', SUCCEED, 'found+"-"+g1', 'ef-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
111 ('$b', 'b', FAIL),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
112 ('a\\(b', 'a(b', SUCCEED, 'found+"-"+g1', 'a(b-Error'),
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
113 ('a\\(*b', 'ab', SUCCEED, 'found', 'ab'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
114 ('a\\(*b', 'a((b', SUCCEED, 'found', 'a((b'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
115 ('a\\\\b', 'a\\b', SUCCEED, 'found', 'a\\b'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
116 ('((a))', 'abc', SUCCEED, 'found+"-"+g1+"-"+g2', 'a-a-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
117 ('(a)b(c)', 'abc', SUCCEED, 'found+"-"+g1+"-"+g2', 'abc-a-c'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
118 ('a+b+c', 'aabbabc', SUCCEED, 'found', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
119 ('(a+|b)*', 'ab', SUCCEED, 'found+"-"+g1', 'ab-b'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
120 ('(a+|b)+', 'ab', SUCCEED, 'found+"-"+g1', 'ab-b'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
121 ('(a+|b)?', 'ab', SUCCEED, 'found+"-"+g1', 'a-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
122 (')(', '-', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
123 ('[^ab]*', 'cde', SUCCEED, 'found', 'cde'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
124 ('abc', '', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
125 ('a*', '', SUCCEED, 'found', ''),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
126 ('a|b|c|d|e', 'e', SUCCEED, 'found', 'e'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
127 ('(a|b|c|d|e)f', 'ef', SUCCEED, 'found+"-"+g1', 'ef-e'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
128 ('abcd*efg', 'abcdefg', SUCCEED, 'found', 'abcdefg'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
129 ('ab*', 'xabyabbbz', SUCCEED, 'found', 'ab'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
130 ('ab*', 'xayabbbz', SUCCEED, 'found', 'a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
131 ('(ab|cd)e', 'abcde', SUCCEED, 'found+"-"+g1', 'cde-cd'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
132 ('[abhgefdc]ij', 'hij', SUCCEED, 'found', 'hij'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
133 ('^(ab|cd)e', 'abcde', FAIL, 'xg1y', 'xy'),
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
134 ('(abc|)ef', 'abcdef', SUCCEED, 'found+"-"+g1', 'ef-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
135 ('(a|b)c*d', 'abcd', SUCCEED, 'found+"-"+g1', 'bcd-b'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
136 ('(ab|ab*)bc', 'abc', SUCCEED, 'found+"-"+g1', 'abc-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
137 ('a([bc]*)c*', 'abc', SUCCEED, 'found+"-"+g1', 'abc-bc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
138 ('a([bc]*)(c*d)', 'abcd', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcd-bc-d'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
139 ('a([bc]+)(c*d)', 'abcd', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcd-bc-d'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
140 ('a([bc]*)(c+d)', 'abcd', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcd-b-cd'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
141 ('a[bcd]*dcdcde', 'adcdcde', SUCCEED, 'found', 'adcdcde'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
142 ('a[bcd]+dcdcde', 'adcdcde', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
143 ('(ab|a)b*c', 'abc', SUCCEED, 'found+"-"+g1', 'abc-ab'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
144 ('((a)(b)c)(d)', 'abcd', SUCCEED, 'g1+"-"+g2+"-"+g3+"-"+g4', 'abc-a-b-d'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
145 ('[a-zA-Z_][a-zA-Z0-9_]*', 'alpha', SUCCEED, 'found', 'alpha'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
146 ('^a(bc+|b[eh])g|.h$', 'abh', SUCCEED, 'found+"-"+g1', 'bh-None'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
147 ('(bc+d$|ef*g.|h?i(j|k))', 'effgz', SUCCEED, 'found+"-"+g1+"-"+g2', 'effgz-effgz-None'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
148 ('(bc+d$|ef*g.|h?i(j|k))', 'ij', SUCCEED, 'found+"-"+g1+"-"+g2', 'ij-ij-j'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
149 ('(bc+d$|ef*g.|h?i(j|k))', 'effg', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
150 ('(bc+d$|ef*g.|h?i(j|k))', 'bcdd', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
151 ('(bc+d$|ef*g.|h?i(j|k))', 'reffgz', SUCCEED, 'found+"-"+g1+"-"+g2', 'effgz-effgz-None'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
152 ('(((((((((a)))))))))', 'a', SUCCEED, 'found', 'a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
153 ('multiple words of text', 'uh-uh', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
154 ('multiple words', 'multiple words, yeah', SUCCEED, 'found', 'multiple words'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
155 ('(.*)c(.*)', 'abcde', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcde-ab-de'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
156 ('\\((.*), (.*)\\)', '(a, b)', SUCCEED, 'g2+"-"+g1', 'b-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
157 ('[k]', 'ab', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
158 ('a[-]?c', 'ac', SUCCEED, 'found', 'ac'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
159 ('(abc)\\1', 'abcabc', SUCCEED, 'g1', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
160 ('([a-c]*)\\1', 'abcabc', SUCCEED, 'g1', 'abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
161 ('^(.+)?B', 'AB', SUCCEED, 'g1', 'A'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
162 ('(a+).\\1$', 'aaaaa', SUCCEED, 'found+"-"+g1', 'aaaaa-aa'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
163 ('^(a+).\\1$', 'aaaa', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
164 ('(abc)\\1', 'abcabc', SUCCEED, 'found+"-"+g1', 'abcabc-abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
165 ('([a-c]+)\\1', 'abcabc', SUCCEED, 'found+"-"+g1', 'abcabc-abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
166 ('(a)\\1', 'aa', SUCCEED, 'found+"-"+g1', 'aa-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
167 ('(a+)\\1', 'aa', SUCCEED, 'found+"-"+g1', 'aa-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
168 ('(a+)+\\1', 'aa', SUCCEED, 'found+"-"+g1', 'aa-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
169 ('(a).+\\1', 'aba', SUCCEED, 'found+"-"+g1', 'aba-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
170 ('(a)ba*\\1', 'aba', SUCCEED, 'found+"-"+g1', 'aba-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
171 ('(aa|a)a\\1$', 'aaa', SUCCEED, 'found+"-"+g1', 'aaa-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
172 ('(a|aa)a\\1$', 'aaa', SUCCEED, 'found+"-"+g1', 'aaa-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
173 ('(a+)a\\1$', 'aaa', SUCCEED, 'found+"-"+g1', 'aaa-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
174 ('([abc]*)\\1', 'abcabc', SUCCEED, 'found+"-"+g1', 'abcabc-abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
175 ('(a)(b)c|ab', 'ab', SUCCEED, 'found+"-"+g1+"-"+g2', 'ab-None-None'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
176 ('(a)+x', 'aaax', SUCCEED, 'found+"-"+g1', 'aaax-a'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
177 ('([ac])+x', 'aacx', SUCCEED, 'found+"-"+g1', 'aacx-c'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
178 ('([^/]*/)*sub1/', 'd:msgs/tdir/sub1/trial/away.cpp', SUCCEED, 'found+"-"+g1', 'd:msgs/tdir/sub1/-tdir/'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
179 ('([^.]*)\\.([^:]*):[T ]+(.*)', 'track1.title:TBlah blah blah', SUCCEED, 'found+"-"+g1+"-"+g2+"-"+g3', 'track1.title:TBlah blah blah-track1-title-Blah blah blah'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
180 ('([^N]*N)+', 'abNNxyzN', SUCCEED, 'found+"-"+g1', 'abNNxyzN-xyzN'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
181 ('([^N]*N)+', 'abNNxyz', SUCCEED, 'found+"-"+g1', 'abNN-N'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
182 ('([abc]*)x', 'abcx', SUCCEED, 'found+"-"+g1', 'abcx-abc'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
183 ('([abc]*)x', 'abc', FAIL),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
184 ('([xyz]*)x', 'abcx', SUCCEED, 'found+"-"+g1', 'x-'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
185 ('(a)+b|aac', 'aac', SUCCEED, 'found+"-"+g1', 'aac-None'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
186
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
187 # Test symbolic groups
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
188
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
189 ('(?P<i d>aaa)a', 'aaaa', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
190 ('(?P<id>aaa)a', 'aaaa', SUCCEED, 'found+"-"+id', 'aaaa-aaa'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
191 ('(?P<id>aa)(?P=id)', 'aaaa', SUCCEED, 'found+"-"+id', 'aaaa-aa'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
192 ('(?P<id>aa)(?P=xd)', 'aaaa', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
193
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
194 # Test octal escapes/memory references
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
195
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
196 ('\\1', 'a', SYNTAX_ERROR),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
197 ('\\09', chr(0) + '9', SUCCEED, 'found', chr(0) + '9'),
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
198 ('\\141', 'a', SUCCEED, 'found', 'a'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
199 ('(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\119', 'abcdefghijklk9', SUCCEED, 'found+"-"+g11', 'abcdefghijklk9-k'),
5794
d79c4fbb1982 Jeffrey's version
Guido van Rossum <guido@python.org>
parents: 5792
diff changeset
200
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
201 # All tests from Perl
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
202
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
203 ('abc', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
204 ('abc', 'xbc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
205 ('abc', 'axc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
206 ('abc', 'abx', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
207 ('abc', 'xabcy', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
208 ('abc', 'ababc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
209 ('ab*c', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
210 ('ab*bc', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
211 ('ab*bc', 'abbc', SUCCEED, 'found', 'abbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
212 ('ab*bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
213 ('ab{0,}bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
214 ('ab+bc', 'abbc', SUCCEED, 'found', 'abbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
215 ('ab+bc', 'abc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
216 ('ab+bc', 'abq', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
217 ('ab{1,}bc', 'abq', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
218 ('ab+bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
219 ('ab{1,}bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
220 ('ab{1,3}bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
221 ('ab{3,4}bc', 'abbbbc', SUCCEED, 'found', 'abbbbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
222 ('ab{4,5}bc', 'abbbbc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
223 ('ab?bc', 'abbc', SUCCEED, 'found', 'abbc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
224 ('ab?bc', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
225 ('ab{0,1}bc', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
226 ('ab?bc', 'abbbbc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
227 ('ab?c', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
228 ('ab{0,1}c', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
229 ('^abc$', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
230 ('^abc$', 'abcc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
231 ('^abc', 'abcc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
232 ('^abc$', 'aabc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
233 ('abc$', 'aabc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
234 ('^', 'abc', SUCCEED, 'found', ''),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
235 ('$', 'abc', SUCCEED, 'found', ''),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
236 ('a.c', 'abc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
237 ('a.c', 'axc', SUCCEED, 'found', 'axc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
238 ('a.*c', 'axyzc', SUCCEED, 'found', 'axyzc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
239 ('a.*c', 'axyzd', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
240 ('a[bc]d', 'abc', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
241 ('a[bc]d', 'abd', SUCCEED, 'found', 'abd'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
242 ('a[b-d]e', 'abd', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
243 ('a[b-d]e', 'ace', SUCCEED, 'found', 'ace'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
244 ('a[b-d]', 'aac', SUCCEED, 'found', 'ac'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
245 ('a[-b]', 'a-', SUCCEED, 'found', 'a-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
246 ('a[b-]', 'a-', SUCCEED, 'found', 'a-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
247 ('a[b-a]', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
248 ('a[]b', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
249 ('a[', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
250 ('a]', 'a]', SUCCEED, 'found', 'a]'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
251 ('a[]]b', 'a]b', SUCCEED, 'found', 'a]b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
252 ('a[^bc]d', 'aed', SUCCEED, 'found', 'aed'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
253 ('a[^bc]d', 'abd', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
254 ('a[^-b]c', 'adc', SUCCEED, 'found', 'adc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
255 ('a[^-b]c', 'a-c', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
256 ('a[^]b]c', 'a]c', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
257 ('a[^]b]c', 'adc', SUCCEED, 'found', 'adc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
258 ('ab|cd', 'abc', SUCCEED, 'found', 'ab'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
259 ('ab|cd', 'abcd', SUCCEED, 'found', 'ab'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
260 ('()ef', 'def', SUCCEED, 'found+"-"+g1', 'ef-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
261 ('*a', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
262 ('(*)b', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
263 ('$b', 'b', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
264 ('a\\', '-', SYNTAX_ERROR),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
265 ('a\\(b', 'a(b', SUCCEED, 'found+"-"+g1', 'a(b-Error'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
266 ('a\\(*b', 'ab', SUCCEED, 'found', 'ab'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
267 ('a\\(*b', 'a((b', SUCCEED, 'found', 'a((b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
268 ('a\\\\b', 'a\\b', SUCCEED, 'found', 'a\\b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
269 ('abc)', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
270 ('(abc', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
271 ('((a))', 'abc', SUCCEED, 'found+"-"+g1+"-"+g2', 'a-a-a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
272 ('(a)b(c)', 'abc', SUCCEED, 'found+"-"+g1+"-"+g2', 'abc-a-c'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
273 ('a+b+c', 'aabbabc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
274 ('a{1,}b{1,}c', 'aabbabc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
275 #('a**', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
276 ('a.+?c', 'abcabc', SUCCEED, 'found', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
277 ('(a+|b)*', 'ab', SUCCEED, 'found+"-"+g1', 'ab-b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
278 ('(a+|b){0,}', 'ab', SUCCEED, 'found+"-"+g1', 'ab-b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
279 ('(a+|b)+', 'ab', SUCCEED, 'found+"-"+g1', 'ab-b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
280 ('(a+|b){1,}', 'ab', SUCCEED, 'found+"-"+g1', 'ab-b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
281 ('(a+|b)?', 'ab', SUCCEED, 'found+"-"+g1', 'a-a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
282 ('(a+|b){0,1}', 'ab', SUCCEED, 'found+"-"+g1', 'a-a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
283 (')(', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
284 ('[^ab]*', 'cde', SUCCEED, 'found', 'cde'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
285 ('abc', '', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
286 ('a*', '', SUCCEED, 'found', ''),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
287 ('([abc])*d', 'abbbcd', SUCCEED, 'found+"-"+g1', 'abbbcd-c'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
288 ('([abc])*bcd', 'abcd', SUCCEED, 'found+"-"+g1', 'abcd-a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
289 ('a|b|c|d|e', 'e', SUCCEED, 'found', 'e'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
290 ('(a|b|c|d|e)f', 'ef', SUCCEED, 'found+"-"+g1', 'ef-e'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
291 ('abcd*efg', 'abcdefg', SUCCEED, 'found', 'abcdefg'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
292 ('ab*', 'xabyabbbz', SUCCEED, 'found', 'ab'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
293 ('ab*', 'xayabbbz', SUCCEED, 'found', 'a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
294 ('(ab|cd)e', 'abcde', SUCCEED, 'found+"-"+g1', 'cde-cd'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
295 ('[abhgefdc]ij', 'hij', SUCCEED, 'found', 'hij'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
296 ('^(ab|cd)e', 'abcde', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
297 ('(abc|)ef', 'abcdef', SUCCEED, 'found+"-"+g1', 'ef-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
298 ('(a|b)c*d', 'abcd', SUCCEED, 'found+"-"+g1', 'bcd-b'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
299 ('(ab|ab*)bc', 'abc', SUCCEED, 'found+"-"+g1', 'abc-a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
300 ('a([bc]*)c*', 'abc', SUCCEED, 'found+"-"+g1', 'abc-bc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
301 ('a([bc]*)(c*d)', 'abcd', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcd-bc-d'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
302 ('a([bc]+)(c*d)', 'abcd', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcd-bc-d'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
303 ('a([bc]*)(c+d)', 'abcd', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcd-b-cd'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
304 ('a[bcd]*dcdcde', 'adcdcde', SUCCEED, 'found', 'adcdcde'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
305 ('a[bcd]+dcdcde', 'adcdcde', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
306 ('(ab|a)b*c', 'abc', SUCCEED, 'found+"-"+g1', 'abc-ab'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
307 ('((a)(b)c)(d)', 'abcd', SUCCEED, 'g1+"-"+g2+"-"+g3+"-"+g4', 'abc-a-b-d'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
308 ('[a-zA-Z_][a-zA-Z0-9_]*', 'alpha', SUCCEED, 'found', 'alpha'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
309 ('^a(bc+|b[eh])g|.h$', 'abh', SUCCEED, 'found+"-"+g1', 'bh-None'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
310 ('(bc+d$|ef*g.|h?i(j|k))', 'effgz', SUCCEED, 'found+"-"+g1+"-"+g2', 'effgz-effgz-None'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
311 ('(bc+d$|ef*g.|h?i(j|k))', 'ij', SUCCEED, 'found+"-"+g1+"-"+g2', 'ij-ij-j'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
312 ('(bc+d$|ef*g.|h?i(j|k))', 'effg', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
313 ('(bc+d$|ef*g.|h?i(j|k))', 'bcdd', FAIL),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
314 ('(bc+d$|ef*g.|h?i(j|k))', 'reffgz', SUCCEED, 'found+"-"+g1+"-"+g2', 'effgz-effgz-None'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
315 ('((((((((((a))))))))))', 'a', SUCCEED, 'g10', 'a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
316 ('((((((((((a))))))))))\\10', 'aa', SUCCEED, 'found', 'aa'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
317 # Python does not have the same rules for \\41 so this is a syntax error
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
318 # ('((((((((((a))))))))))\\41', 'aa', FAIL),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
319 # ('((((((((((a))))))))))\\41', 'a!', SUCCEED, 'found', 'a!'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
320 ('(((((((((a)))))))))', 'a', SUCCEED, 'found', 'a'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
321 ('multiple words of text', 'uh-uh', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
322 ('multiple words', 'multiple words, yeah', SUCCEED, 'found', 'multiple words'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
323 ('(.*)c(.*)', 'abcde', SUCCEED, 'found+"-"+g1+"-"+g2', 'abcde-ab-de'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
324 ('\\((.*), (.*)\\)', '(a, b)', SUCCEED, 'g2+"-"+g1', 'b-a'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
325 ('[k]', 'ab', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
326 ##('abcd', 'abcd', SUCCEED, 'found+"-"+\\found+"-"+\\\\found', 'abcd-$&-\\abcd'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
327 ##('a(bc)d', 'abcd', SUCCEED, 'g1+"-"+\\g1+"-"+\\\\g1', 'bc-$1-\\bc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
328 ('a[-]?c', 'ac', SUCCEED, 'found', 'ac'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
329 ('(abc)\\1', 'abcabc', SUCCEED, 'g1', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
330 ('([a-c]*)\\1', 'abcabc', SUCCEED, 'g1', 'abc'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
331 ('(?i)abc', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
332 ('(?i)abc', 'XBC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
333 ('(?i)abc', 'AXC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
334 ('(?i)abc', 'ABX', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
335 ('(?i)abc', 'XABCY', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
336 ('(?i)abc', 'ABABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
337 ('(?i)ab*c', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
338 ('(?i)ab*bc', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
339 ('(?i)ab*bc', 'ABBC', SUCCEED, 'found', 'ABBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
340 ('(?i)ab*?bc', 'ABBBBC', SUCCEED, 'found', 'ABBBBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
341 ('(?i)ab{0,}?bc', 'ABBBBC', SUCCEED, 'found', 'ABBBBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
342 ('(?i)ab+?bc', 'ABBC', SUCCEED, 'found', 'ABBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
343 ('(?i)ab+bc', 'ABC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
344 ('(?i)ab+bc', 'ABQ', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
345 ('(?i)ab{1,}bc', 'ABQ', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
346 ('(?i)ab+bc', 'ABBBBC', SUCCEED, 'found', 'ABBBBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
347 ('(?i)ab{1,}?bc', 'ABBBBC', SUCCEED, 'found', 'ABBBBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
348 ('(?i)ab{1,3}?bc', 'ABBBBC', SUCCEED, 'found', 'ABBBBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
349 ('(?i)ab{3,4}?bc', 'ABBBBC', SUCCEED, 'found', 'ABBBBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
350 ('(?i)ab{4,5}?bc', 'ABBBBC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
351 ('(?i)ab??bc', 'ABBC', SUCCEED, 'found', 'ABBC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
352 ('(?i)ab??bc', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
353 ('(?i)ab{0,1}?bc', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
354 ('(?i)ab??bc', 'ABBBBC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
355 ('(?i)ab??c', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
356 ('(?i)ab{0,1}?c', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
357 ('(?i)^abc$', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
358 ('(?i)^abc$', 'ABCC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
359 ('(?i)^abc', 'ABCC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
360 ('(?i)^abc$', 'AABC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
361 ('(?i)abc$', 'AABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
362 ('(?i)^', 'ABC', SUCCEED, 'found', ''),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
363 ('(?i)$', 'ABC', SUCCEED, 'found', ''),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
364 ('(?i)a.c', 'ABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
365 ('(?i)a.c', 'AXC', SUCCEED, 'found', 'AXC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
366 ('(?i)a.*?c', 'AXYZC', SUCCEED, 'found', 'AXYZC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
367 ('(?i)a.*c', 'AXYZD', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
368 ('(?i)a[bc]d', 'ABC', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
369 ('(?i)a[bc]d', 'ABD', SUCCEED, 'found', 'ABD'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
370 ('(?i)a[b-d]e', 'ABD', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
371 ('(?i)a[b-d]e', 'ACE', SUCCEED, 'found', 'ACE'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
372 ('(?i)a[b-d]', 'AAC', SUCCEED, 'found', 'AC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
373 ('(?i)a[-b]', 'A-', SUCCEED, 'found', 'A-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
374 ('(?i)a[b-]', 'A-', SUCCEED, 'found', 'A-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
375 ('(?i)a[b-a]', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
376 ('(?i)a[]b', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
377 ('(?i)a[', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
378 ('(?i)a]', 'A]', SUCCEED, 'found', 'A]'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
379 ('(?i)a[]]b', 'A]B', SUCCEED, 'found', 'A]B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
380 ('(?i)a[^bc]d', 'AED', SUCCEED, 'found', 'AED'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
381 ('(?i)a[^bc]d', 'ABD', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
382 ('(?i)a[^-b]c', 'ADC', SUCCEED, 'found', 'ADC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
383 ('(?i)a[^-b]c', 'A-C', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
384 ('(?i)a[^]b]c', 'A]C', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
385 ('(?i)a[^]b]c', 'ADC', SUCCEED, 'found', 'ADC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
386 ('(?i)ab|cd', 'ABC', SUCCEED, 'found', 'AB'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
387 ('(?i)ab|cd', 'ABCD', SUCCEED, 'found', 'AB'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
388 ('(?i)()ef', 'DEF', SUCCEED, 'found+"-"+g1', 'EF-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
389 ('(?i)*a', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
390 ('(?i)(*)b', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
391 ('(?i)$b', 'B', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
392 ('(?i)a\\', '-', SYNTAX_ERROR),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
393 ('(?i)a\\(b', 'A(B', SUCCEED, 'found+"-"+g1', 'A(B-Error'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
394 ('(?i)a\\(*b', 'AB', SUCCEED, 'found', 'AB'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
395 ('(?i)a\\(*b', 'A((B', SUCCEED, 'found', 'A((B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
396 ('(?i)a\\\\b', 'A\\B', SUCCEED, 'found', 'A\\B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
397 ('(?i)abc)', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
398 ('(?i)(abc', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
399 ('(?i)((a))', 'ABC', SUCCEED, 'found+"-"+g1+"-"+g2', 'A-A-A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
400 ('(?i)(a)b(c)', 'ABC', SUCCEED, 'found+"-"+g1+"-"+g2', 'ABC-A-C'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
401 ('(?i)a+b+c', 'AABBABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
402 ('(?i)a{1,}b{1,}c', 'AABBABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
403 #('(?i)a**', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
404 ('(?i)a.+?c', 'ABCABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
405 ('(?i)a.*?c', 'ABCABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
406 ('(?i)a.{0,5}?c', 'ABCABC', SUCCEED, 'found', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
407 ('(?i)(a+|b)*', 'AB', SUCCEED, 'found+"-"+g1', 'AB-B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
408 ('(?i)(a+|b){0,}', 'AB', SUCCEED, 'found+"-"+g1', 'AB-B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
409 ('(?i)(a+|b)+', 'AB', SUCCEED, 'found+"-"+g1', 'AB-B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
410 ('(?i)(a+|b){1,}', 'AB', SUCCEED, 'found+"-"+g1', 'AB-B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
411 ('(?i)(a+|b)?', 'AB', SUCCEED, 'found+"-"+g1', 'A-A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
412 ('(?i)(a+|b){0,1}', 'AB', SUCCEED, 'found+"-"+g1', 'A-A'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
413 ('(?i)(a+|b){0,1}?', 'AB', SUCCEED, 'found+"-"+g1', '-None'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
414 ('(?i))(', '-', SYNTAX_ERROR),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
415 ('(?i)[^ab]*', 'CDE', SUCCEED, 'found', 'CDE'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
416 ('(?i)abc', '', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
417 ('(?i)a*', '', SUCCEED, 'found', ''),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
418 ('(?i)([abc])*d', 'ABBBCD', SUCCEED, 'found+"-"+g1', 'ABBBCD-C'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
419 ('(?i)([abc])*bcd', 'ABCD', SUCCEED, 'found+"-"+g1', 'ABCD-A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
420 ('(?i)a|b|c|d|e', 'E', SUCCEED, 'found', 'E'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
421 ('(?i)(a|b|c|d|e)f', 'EF', SUCCEED, 'found+"-"+g1', 'EF-E'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
422 ('(?i)abcd*efg', 'ABCDEFG', SUCCEED, 'found', 'ABCDEFG'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
423 ('(?i)ab*', 'XABYABBBZ', SUCCEED, 'found', 'AB'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
424 ('(?i)ab*', 'XAYABBBZ', SUCCEED, 'found', 'A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
425 ('(?i)(ab|cd)e', 'ABCDE', SUCCEED, 'found+"-"+g1', 'CDE-CD'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
426 ('(?i)[abhgefdc]ij', 'HIJ', SUCCEED, 'found', 'HIJ'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
427 ('(?i)^(ab|cd)e', 'ABCDE', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
428 ('(?i)(abc|)ef', 'ABCDEF', SUCCEED, 'found+"-"+g1', 'EF-'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
429 ('(?i)(a|b)c*d', 'ABCD', SUCCEED, 'found+"-"+g1', 'BCD-B'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
430 ('(?i)(ab|ab*)bc', 'ABC', SUCCEED, 'found+"-"+g1', 'ABC-A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
431 ('(?i)a([bc]*)c*', 'ABC', SUCCEED, 'found+"-"+g1', 'ABC-BC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
432 ('(?i)a([bc]*)(c*d)', 'ABCD', SUCCEED, 'found+"-"+g1+"-"+g2', 'ABCD-BC-D'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
433 ('(?i)a([bc]+)(c*d)', 'ABCD', SUCCEED, 'found+"-"+g1+"-"+g2', 'ABCD-BC-D'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
434 ('(?i)a([bc]*)(c+d)', 'ABCD', SUCCEED, 'found+"-"+g1+"-"+g2', 'ABCD-B-CD'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
435 ('(?i)a[bcd]*dcdcde', 'ADCDCDE', SUCCEED, 'found', 'ADCDCDE'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
436 ('(?i)a[bcd]+dcdcde', 'ADCDCDE', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
437 ('(?i)(ab|a)b*c', 'ABC', SUCCEED, 'found+"-"+g1', 'ABC-AB'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
438 ('(?i)((a)(b)c)(d)', 'ABCD', SUCCEED, 'g1+"-"+g2+"-"+g3+"-"+g4', 'ABC-A-B-D'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
439 ('(?i)[a-zA-Z_][a-zA-Z0-9_]*', 'ALPHA', SUCCEED, 'found', 'ALPHA'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
440 ('(?i)^a(bc+|b[eh])g|.h$', 'ABH', SUCCEED, 'found+"-"+g1', 'BH-None'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
441 ('(?i)(bc+d$|ef*g.|h?i(j|k))', 'EFFGZ', SUCCEED, 'found+"-"+g1+"-"+g2', 'EFFGZ-EFFGZ-None'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
442 ('(?i)(bc+d$|ef*g.|h?i(j|k))', 'IJ', SUCCEED, 'found+"-"+g1+"-"+g2', 'IJ-IJ-J'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
443 ('(?i)(bc+d$|ef*g.|h?i(j|k))', 'EFFG', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
444 ('(?i)(bc+d$|ef*g.|h?i(j|k))', 'BCDD', FAIL),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
445 ('(?i)(bc+d$|ef*g.|h?i(j|k))', 'REFFGZ', SUCCEED, 'found+"-"+g1+"-"+g2', 'EFFGZ-EFFGZ-None'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
446 ('(?i)((((((((((a))))))))))', 'A', SUCCEED, 'g10', 'A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
447 ('(?i)((((((((((a))))))))))\\10', 'AA', SUCCEED, 'found', 'AA'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
448 #('(?i)((((((((((a))))))))))\\41', 'AA', FAIL),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
449 #('(?i)((((((((((a))))))))))\\41', 'A!', SUCCEED, 'found', 'A!'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
450 ('(?i)(((((((((a)))))))))', 'A', SUCCEED, 'found', 'A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
451 ('(?i)(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))', 'A', SUCCEED, 'g1', 'A'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
452 ('(?i)(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))', 'C', SUCCEED, 'g1', 'C'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
453 ('(?i)multiple words of text', 'UH-UH', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
454 ('(?i)multiple words', 'MULTIPLE WORDS, YEAH', SUCCEED, 'found', 'MULTIPLE WORDS'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
455 ('(?i)(.*)c(.*)', 'ABCDE', SUCCEED, 'found+"-"+g1+"-"+g2', 'ABCDE-AB-DE'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
456 ('(?i)\\((.*), (.*)\\)', '(A, B)', SUCCEED, 'g2+"-"+g1', 'B-A'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
457 ('(?i)[k]', 'AB', FAIL),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
458 ##('(?i)abcd', 'ABCD', SUCCEED, 'found+"-"+\\found+"-"+\\\\found', 'ABCD-$&-\\ABCD'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
459 ##('(?i)a(bc)d', 'ABCD', SUCCEED, 'g1+"-"+\\g1+"-"+\\\\g1', 'BC-$1-\\BC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
460 ('(?i)a[-]?c', 'AC', SUCCEED, 'found', 'AC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
461 ('(?i)(abc)\\1', 'ABCABC', SUCCEED, 'g1', 'ABC'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
462 ('(?i)([a-c]*)\\1', 'ABCABC', SUCCEED, 'g1', 'ABC'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
463 # these zero-width assertions are not supported
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
464 #('a(?!b).', 'abad', SUCCEED, 'found', 'ad'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
465 #('a(?=d).', 'abad', SUCCEED, 'found', 'ad'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
466 #('a(?=c|d).', 'abad', SUCCEED, 'found', 'ad'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
467 ('a(?:b|c|d)(.)', 'ace', SUCCEED, 'g1', 'e'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
468 ('a(?:b|c|d)*(.)', 'ace', SUCCEED, 'g1', 'e'),
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
469 ('a(?:b|c|d)+?(.)', 'ace', SUCCEED, 'g1', 'e'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
470 ('a(?:b|(c|e){1,2}?|d)+?(.)', 'ace', SUCCEED, 'g1 + g2', 'ce'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
471 ('^(.+)?B', 'AB', SUCCEED, 'g1', 'A'),
5805
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
472
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
473 # Comments using the (?#...) syntax
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
474
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
475 ('w(?# comment', 'w', SYNTAX_ERROR),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
476 ('w(?# comment 1)xy(?# comment 2)z', 'wxyz', SUCCEED, 'found', 'wxyz'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
477
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
478 # Comments using the x embedded pattern modifier (in an unusual place too)
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
479
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
480 ("""w# comment 1
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
481 x(?x) y
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
482 # comment 2
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
483 z""", 'wxyz', SUCCEED, 'found', 'wxyz'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
484
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
485 # using the m embedded pattern modifier
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
486
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
487 ('^abc', """jkl
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
488 abc
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
489 xyz""", FAIL),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
490 ('(?m)^abc', """jkl
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
491 abc
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
492 xyz""", SUCCEED, 'found', 'abc'),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
493
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
494 # using the s embedded pattern modifier
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
495
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
496 ('a.b', 'a\nb', FAIL),
518d4f0c8fcc Jeffrey's latest -- seems to solve most problems!
Guido van Rossum <guido@python.org>
parents: 5798
diff changeset
497 ('(?s)a.b', 'a\nb', SUCCEED, 'found', 'a\nb'),
5795
3d1d8055087f Merged my changes in, and added all converted Perl tests.
Guido van Rossum <guido@python.org>
parents: 5794
diff changeset
498 ]