1# Tests of \C when Unicode support is available. Note that \C is not supported 2# for DFA matching in UTF mode, so this test is not run with -dfa. The output 3# of this test is different in 8-, 16-, and 32-bit modes. Some tests may match 4# in some widths and not in others. 5 6/ab\Cde/utf,info 7Capture group count = 0 8Contains \C 9Options: utf 10First code unit = 'a' 11Last code unit = 'e' 12Subject length lower bound = 0 13 abXde 14 0: abXde 15 16# This should produce an error diagnostic (\C in UTF lookbehind) in 8-bit and 17# 16-bit modes, but not in 32-bit mode. 18 19/(?<=ab\Cde)X/utf 20Failed: error 136 at offset 0: \C is not allowed in a lookbehind assertion in UTF-8 mode 21 ab!deXYZ 22 23# Autopossessification tests 24 25/\C+\X \X+\C/Bx 26------------------------------------------------------------------ 27 Bra 28 AllAny+ 29 extuni 30 extuni+ 31 AllAny 32 Ket 33 End 34------------------------------------------------------------------ 35 36/\C+\X \X+\C/Bx,utf 37------------------------------------------------------------------ 38 Bra 39 Anybyte+ 40 extuni 41 extuni+ 42 Anybyte 43 Ket 44 End 45------------------------------------------------------------------ 46 47/\C\X*TӅ; 48{0,6}\v+ 49F 50/utf 51\= Expect no match 52 Ӆ\x0a 53No match 54 55/\C(\W?ſ)'?{{/utf 56\= Expect no match 57 \\C(\\W?ſ)'?{{ 58No match 59 60/X(\C{3})/utf 61 X\x{1234} 62 0: X\x{1234} 63 1: \x{1234} 64 X\x{11234}Y 65 0: X\x{f0}\x{91}\x{88} 66 1: \x{f0}\x{91}\x{88} 67 X\x{11234}YZ 68 0: X\x{f0}\x{91}\x{88} 69 1: \x{f0}\x{91}\x{88} 70 71/X(\C{4})/utf 72 X\x{1234}YZ 73 0: X\x{1234}Y 74 1: \x{1234}Y 75 X\x{11234}YZ 76 0: X\x{11234} 77 1: \x{11234} 78 X\x{11234}YZW 79 0: X\x{11234} 80 1: \x{11234} 81 82/X\C*/utf 83 XYZabcdce 84 0: XYZabcdce 85 86/X\C*?/utf 87 XYZabcde 88 0: X 89 90/X\C{3,5}/utf 91 Xabcdefg 92 0: Xabcde 93 X\x{1234} 94 0: X\x{1234} 95 X\x{1234}YZ 96 0: X\x{1234}YZ 97 X\x{1234}\x{512} 98 0: X\x{1234}\x{512} 99 X\x{1234}\x{512}YZ 100 0: X\x{1234}\x{512} 101 X\x{11234}Y 102 0: X\x{11234}Y 103 X\x{11234}YZ 104 0: X\x{11234}Y 105 X\x{11234}\x{512} 106 0: X\x{11234}\x{d4} 107 X\x{11234}\x{512}YZ 108 0: X\x{11234}\x{d4} 109 X\x{11234}\x{512}\x{11234}Z 110 0: X\x{11234}\x{d4} 111 112/X\C{3,5}?/utf 113 Xabcdefg 114 0: Xabc 115 X\x{1234} 116 0: X\x{1234} 117 X\x{1234}YZ 118 0: X\x{1234} 119 X\x{1234}\x{512} 120 0: X\x{1234} 121 X\x{11234}Y 122 0: X\x{f0}\x{91}\x{88} 123 X\x{11234}YZ 124 0: X\x{f0}\x{91}\x{88} 125 X\x{11234}\x{512}YZ 126 0: X\x{f0}\x{91}\x{88} 127 X\x{11234} 128 0: X\x{f0}\x{91}\x{88} 129 130/a\Cb/utf 131 aXb 132 0: aXb 133 a\nb 134 0: a\x{0a}b 135 a\x{100}b 136No match 137 138/a\C\Cb/utf 139 a\x{100}b 140 0: a\x{100}b 141 a\x{12257}b 142No match 143 a\x{12257}\x{11234}b 144No match 145 146/ab\Cde/utf 147 abXde 148 0: abXde 149 150# This one is here not because it's different to Perl, but because the way 151# the captured single code unit is displayed. (In Perl it becomes a character, 152# and you can't tell the difference.) 153 154/X(\C)(.*)/utf 155 X\x{1234} 156 0: X\x{1234} 157 1: \x{e1} 158 2: \x{88}\x{b4} 159 X\nabc 160 0: X\x{0a}abc 161 1: \x{0a} 162 2: abc 163 164# This one is here because Perl gives out a grumbly error message (quite 165# correctly, but that messes up comparisons). 166 167/a\Cb/utf 168\= Expect no match in 8-bit mode 169 a\x{100}b 170No match 171 172/^ab\C/utf,no_start_optimize 173\= Expect no match - tests \C at end of subject 174 ab 175No match 176 177/\C[^\v]+\x80/utf 178 [AΏBŀC] 179No match 180 181/\C[^\d]+\x80/utf 182 [AΏBŀC] 183No match 184 185# End of testinput22 186