oxedyne/fe2o3/fe2o3_text/tests/regex_oracle/corpus.txt
6.8 KiB, 1 run
created by r1870400018:60336, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | # The regular expression corpus that oracle.pl runs through Perl to write expected.txt. |
| 2 | # |
| 3 | # P a pattern, in the syntax of the Rust `regex` crate |
| 4 | # Q the same pattern in Perl's syntax, where the two differ (`\p{Greek}` is Script in Rust |
| 5 | # and Script_Extensions in Perl; `\u{..}`, `\<` and class set operations are Rust's only) |
| 6 | # R a replacement template, expanded as the `regex` crate expands one |
| 7 | # H a haystack; `\n`, `\t` and `\x{..}` are decoded, so a haystack cannot hold a backslash |
| 8 | # |
| 9 | # Every H is run against the P above it. A group inside a repetition keeps its capture from an |
| 10 | # earlier iteration in the `regex` crate (and in Python) but is reset in Perl, so no such case is |
| 11 | # here; tests/regex.rs checks those against Python's answers. Nor is a repetition whose later |
| 12 | # iteration can match nothing, `(a*)+`, where Perl and Python report the empty last iteration and |
| 13 | # the crate does not; rust_suite.txt carries the crate's own cases for that. Perl's `$` also matches before a final newline and |
| 14 | # Rust's does not, so no haystack under a `$` pattern ends in one; Perl's case-insensitivity |
| 15 | # folds `ß` to `ss` and Rust's does not, so no case-insensitive pattern meets an `ß`. |
| 16 | |
| 17 | # Literals and dot |
| 18 | P abc |
| 19 | H xxabcxxabc |
| 20 | H ab |
| 21 | P a.c |
| 22 | H abc a\nc a\x{3bb}c |
| 23 | P (?s)a.c |
| 24 | H a\nc abc |
| 25 | |
| 26 | # Classes |
| 27 | P [a-c]+ |
| 28 | H zzabcbazz ab c |
| 29 | P [^a-c\s]+ |
| 30 | H ab xyz\tcab |
| 31 | P [\d.]+x |
| 32 | H 3.14x and 1x |
| 33 | P [\]\-]+ |
| 34 | H a]-]b |
| 35 | P [a-z&&[^aeiou]]+ |
| 36 | Q (?:(?![aeiou])[a-z])+ |
| 37 | H rhythm and blues |
| 38 | P [a-z--[aeiou]]+ |
| 39 | Q (?:(?![aeiou])[a-z])+ |
| 40 | H strengths |
| 41 | P [a-f~~c-h]+ |
| 42 | Q [abgh]+ |
| 43 | H abcdefghij |
| 44 | P [[:alpha:]]+ |
| 45 | Q [A-Za-z]+ |
| 46 | H abc\x{3bb}\x{3bc}DEF12 |
| 47 | P [[:^digit:][:space:]]+ |
| 48 | Q [^0-9]+ |
| 49 | H 12ab 34 |
| 50 | P [[:punct:]]+ |
| 51 | Q [!-\/:-\@\[-`{-~]+ |
| 52 | H a,b;c!?d |
| 53 | |
| 54 | # Unicode shorthands |
| 55 | P \d+ |
| 56 | H x\x{661}\x{662}\x{663}y 42 \x{ff11}\x{ff12} \x{966}\x{967} |
| 57 | P \w+ |
| 58 | H caf\x{e9} na\x{ef}ve \x{3bb}\x{3cc}\x{3b3}\x{3bf}\x{3c2} e\x{301}t\x{e9} a_b \x{4e2d}\x{6587} |
| 59 | P \s+ |
| 60 | H a\x{a0}b\x{3000}c\x{2028}d\x{85}e\x{1680}f |
| 61 | P \S+ |
| 62 | H a\x{a0}b\x{3000}c |
| 63 | P \W+ |
| 64 | H ab, \x{3bb}; \x{200d}! |
| 65 | P \D+ |
| 66 | H \x{661}a\x{662} |
| 67 | |
| 68 | # Boundaries |
| 69 | P \bcat\b |
| 70 | H cat concat cat. (cat) |
| 71 | P \Bcat\B |
| 72 | H concatenate cat |
| 73 | P \b\w+\b |
| 74 | H \x{3bb}\x{3cc}\x{3b3}\x{3bf}\x{3c2} \x{3ba}\x{3b1}\x{3b9}! caf\x{e9} |
| 75 | P \b |
| 76 | H ab cd |
| 77 | P \B |
| 78 | H ab c |
| 79 | P \<\w+ |
| 80 | Q (?<!\w)(?=\w)\w+ |
| 81 | H ab cd, ef |
| 82 | P \w+\> |
| 83 | Q \w+(?<=\w)(?!\w) |
| 84 | H ab cd, ef |
| 85 | P \b{start}. |
| 86 | Q (?<!\w)(?=\w). |
| 87 | H x y,z |
| 88 | P .\b{end} |
| 89 | Q .(?<=\w)(?!\w) |
| 90 | H x y,z |
| 91 | P \b{start-half}. |
| 92 | Q (?<!\w). |
| 93 | H ab c |
| 94 | P .\b{end-half} |
| 95 | Q .(?!\w) |
| 96 | H ab c |
| 97 | |
| 98 | # Anchors and multi-line |
| 99 | P ^\w+ |
| 100 | H ab cd |
| 101 | H \x{3bb}x |
| 102 | P \w+$ |
| 103 | H ab cd |
| 104 | P (?m)^\w+ |
| 105 | H ab\ncd\nef |
| 106 | P (?m)\w+$ |
| 107 | H ab\ncd\nef |
| 108 | P \A\w |
| 109 | H ab |
| 110 | P \w\z |
| 111 | H ab |
| 112 | P (?m)^$ |
| 113 | H a\n\nb |
| 114 | |
| 115 | # Quantifiers |
| 116 | P a{2,3} |
| 117 | H aaaaaaa |
| 118 | P a{2,}? |
| 119 | H aaaaa |
| 120 | P a{3} |
| 121 | H aaaaaaa |
| 122 | P a+?b |
| 123 | H aaab |
| 124 | P <.*?> |
| 125 | H <a><bc> |
| 126 | P <.*> |
| 127 | H <a><bc> |
| 128 | P x* |
| 129 | H axxb |
| 130 | P (ab)*c |
| 131 | H abababc c abc |
| 132 | P a? |
| 133 | H baa |
| 134 | |
| 135 | # Alternation |
| 136 | P a|ab |
| 137 | H ab |
| 138 | P ab|a |
| 139 | H ab |
| 140 | P cat|dog|bird |
| 141 | H a dog and a bird and a cat |
| 142 | P (?:a|b)+c |
| 143 | H abbac |
| 144 | |
| 145 | # Capture groups |
| 146 | P (\w+)@(\w+)\.com |
| 147 | H mail joe@site.com and ann@web.com |
| 148 | P (a)|(b) |
| 149 | H ab |
| 150 | P (a|(b))+ |
| 151 | H ba |
| 152 | P (?P<year>\d{4})-(?P<month>\d{2}) |
| 153 | R $month/$year |
| 154 | H 2026-09 and 1999-12 |
| 155 | P (?<first>\w)(?<rest>\w*) |
| 156 | R ${rest}${first}ay |
| 157 | H pig latin |
| 158 | P (\d)(\d)? |
| 159 | R [$2$1] |
| 160 | H 1 23 456 |
| 161 | P (a*)* |
| 162 | H b |
| 163 | P () |
| 164 | H ab |
| 165 | P (x)?y |
| 166 | H y xy |
| 167 | P (\p{Lu})(\p{Ll}+) |
| 168 | R $2$1 |
| 169 | H Alpha Beta gamma \x{394}\x{3ad}\x{3bb}\x{3c4}\x{3b1} |
| 170 | |
| 171 | # Unicode properties |
| 172 | P \p{L}+ |
| 173 | H ab12\x{3bb}\x{3bc}-\x{4e2d}\x{6587} \x{627}\x{644} |
| 174 | P \pL+ |
| 175 | H ab12\x{3bb} |
| 176 | P \PL+ |
| 177 | H ab12\x{3bb}--c |
| 178 | P \p{Lu} |
| 179 | H aBc\x{394}\x{3b4} |
| 180 | P \p{Ll}+ |
| 181 | H aBc\x{394}\x{3b4} |
| 182 | P \p{Uppercase_Letter}+ |
| 183 | H aBC\x{394}\x{3b4} |
| 184 | P \p{gc=Nd}+ |
| 185 | H ab\x{661}\x{662}12 |
| 186 | P \p{General_Category=Decimal_Number}+ |
| 187 | H ab\x{661}\x{662}12 |
| 188 | P \p{Letter}+ |
| 189 | H x1y |
| 190 | P \p{N}+ |
| 191 | H x\x{bd}\x{2163}9y |
| 192 | P \p{Nl} |
| 193 | H x\x{2163}9y |
| 194 | P \p{No} |
| 195 | H x\x{bd}9y |
| 196 | P \p{P}+ |
| 197 | H a,.!?b\x{201c}c\x{201d} |
| 198 | P \p{Ps}\p{Pe} |
| 199 | H ()[]{} |
| 200 | P \p{S}+ |
| 201 | H a+\x{20ac}$\x{a9}b |
| 202 | P \p{Sc} |
| 203 | H a$\x{20ac}\x{a3}b |
| 204 | P \p{Z}+ |
| 205 | H a \x{a0}\x{2028}b |
| 206 | P \p{Zs}+ |
| 207 | H a \x{a0}\x{2028}b |
| 208 | P \p{Cc}+ |
| 209 | H a\tb\x{7f}c |
| 210 | P \p{Cf} |
| 211 | H a\x{200b}\x{ad}b |
| 212 | P \p{M}+ |
| 213 | H e\x{301}\x{302}a\x{93f} |
| 214 | P \p{Mn}+ |
| 215 | H e\x{301}\x{302}a\x{93f} |
| 216 | P \p{Mc} |
| 217 | H e\x{301}a\x{93f} |
| 218 | P \p{LC}+ |
| 219 | H a\x{2c6}B\x{1c5} |
| 220 | P \p{gc!=L}+ |
| 221 | Q \P{L}+ |
| 222 | H ab12cd |
| 223 | P \p{Greek}+ |
| 224 | Q \p{sc=Greek}+ |
| 225 | H abc\x{3bb}\x{3cc}\x{3b3}\x{3bf}\x{3c2}\x{b7}x |
| 226 | P \p{sc=Grek}+ |
| 227 | H \x{3bb}\x{3cc}\x{342}\x{3b3} |
| 228 | P \p{scx=Grek}+ |
| 229 | H \x{3bb}\x{3cc}\x{342}\x{3b3} |
| 230 | P \p{Script_Extensions=Greek}+ |
| 231 | Q \p{scx=Grek}+ |
| 232 | H \x{3bb}\x{3cc}\x{342}\x{3b3} |
| 233 | P \p{Latin}+ |
| 234 | Q \p{sc=Latin}+ |
| 235 | H caf\x{e9} \x{3bb} |
| 236 | P \p{Han}+ |
| 237 | Q \p{sc=Han}+ |
| 238 | H \x{4e2d}\x{6587}\x{3001}x |
| 239 | P \p{scx=Hani}+ |
| 240 | H \x{4e2d}\x{6587}\x{3001}x |
| 241 | P \p{Cyrillic}+ |
| 242 | Q \p{sc=Cyrillic}+ |
| 243 | H \x{41f}\x{440}\x{438}\x{432}\x{435}\x{442} mir |
| 244 | P \p{Arabic}+ |
| 245 | Q \p{sc=Arabic}+ |
| 246 | H \x{627}\x{644}\x{633}\x{644}\x{627}\x{645} \x{660} |
| 247 | P \p{scx=Arab}+ |
| 248 | H \x{627}\x{644}\x{60c}\x{660} |
| 249 | P \p{Common}+ |
| 250 | Q \p{sc=Common}+ |
| 251 | H ab 12,\x{3000} |
| 252 | P \p{Inherited}+ |
| 253 | Q \p{sc=Inherited}+ |
| 254 | H e\x{301}\x{302}x |
| 255 | P \p{Devanagari}+ |
| 256 | Q \p{sc=Devanagari}+ |
| 257 | H \x{928}\x{92e}\x{938}\x{94d}\x{924}\x{947} \x{966} |
| 258 | P \p{Hiragana}+ |
| 259 | Q \p{sc=Hiragana}+ |
| 260 | H \x{3072}\x{3089}\x{304c}\x{306a}\x{30ab}\x{30bf} |
| 261 | P \P{Greek}+ |
| 262 | Q \P{sc=Greek}+ |
| 263 | H ab\x{3bb}cd |
| 264 | P \p{sc!=Latin}+ |
| 265 | Q \P{sc=Latin}+ |
| 266 | H ab\x{3bb}\x{3bc}cd |
| 267 | P \p{Alphabetic}+ |
| 268 | H x\x{2163}y1 |
| 269 | P \p{Alpha}+ |
| 270 | Q \p{Alphabetic}+ |
| 271 | H x\x{2163}y1 |
| 272 | P \p{White_Space}+ |
| 273 | H a \x{85}\x{2029}b |
| 274 | P \p{WSpace}+ |
| 275 | Q \p{White_Space}+ |
| 276 | H a \x{85}b |
| 277 | P \p{Uppercase}+ |
| 278 | H a\x{2160}B\x{24b6}c |
| 279 | P \p{Lowercase}+ |
| 280 | H A\x{aa}b\x{2170}C |
| 281 | P \p{Emoji}+ |
| 282 | H a\x{1f600}\x{2764}#1 |
| 283 | P \p{Extended_Pictographic}+ |
| 284 | H a\x{1f600}\x{2764}\x{a9}#1 |
| 285 | P \p{Emoji_Presentation}+ |
| 286 | H a\x{1f600}\x{2764}# |
| 287 | P \p{Ideographic}+ |
| 288 | H \x{4e2d}\x{3007}a |
| 289 | P \p{Math}+ |
| 290 | H a+\x{2211}=b |
| 291 | P \p{Dash}+ |
| 292 | H a-\x{2014}b |
| 293 | P \p{Hex_Digit}+ |
| 294 | H xyzAF09\x{ff21}g |
| 295 | P \p{Any}+ |
| 296 | H a\x{3bb}\n\x{1f600} |
| 297 | P \p{ASCII}+ |
| 298 | H ab\x{3bb}cd |
| 299 | P \p{Assigned}+ |
| 300 | H ab\x{378}cd |
| 301 | P \p{Cn}+ |
| 302 | H ab\x{378}\x{379}cd |
| 303 | P \p{is Greek}+ |
| 304 | Q \p{sc=Greek}+ |
| 305 | H ab\x{3bb} |
| 306 | P \p{ letter }+ |
| 307 | Q \p{L}+ |
| 308 | H 1ab2 |
| 309 | P \p{lowercase-letter}+ |
| 310 | Q \p{Ll}+ |
| 311 | H ABcdEF |
| 312 | P \p{gc=lowercaseletter}+ |
| 313 | Q \p{Ll}+ |
| 314 | H ABcdEF |
| 315 | P [\p{Greek}\d]+ |
| 316 | Q [\p{sc=Greek}\d]+ |
| 317 | H ab\x{3bb}12\x{3bc}c |
| 318 | P [^\p{L}\s]+ |
| 319 | H ab, 12 \x{3bb}; |
| 320 | P [\p{L}&&\p{Greek}]+ |
| 321 | Q (?:(?=\p{sc=Greek})\p{L})+ |
| 322 | H a\x{3bb}\x{375}\x{3bc}b |
| 323 | P [\p{L}--\p{Latin}]+ |
| 324 | Q (?:(?!\p{sc=Latin})\p{L})+ |
| 325 | H ab\x{3bb}\x{3bc}\x{4e2d}c |
| 326 | P [\P{L}a]+ |
| 327 | H xa1b2 |
| 328 | P [\w--\d]+ |
| 329 | Q (?:(?!\d)\w)+ |
| 330 | H ab12c_d3 |
| 331 | |
| 332 | # Flags |
| 333 | P (?i)hello |
| 334 | H say HeLLo there |
| 335 | P (?i)[a-c]+ |
| 336 | H xABCy |
| 337 | P (?i)[^a] |
| 338 | H aAb |
| 339 | P (?i)\x{3a3}\x{39f}\x{3a6} |
| 340 | H \x{3c3}\x{3bf}\x{3c6} \x{3c2}\x{3bf}\x{3c6} |
| 341 | P (?i)k |
| 342 | H K\x{212a}k |
| 343 | P (?i)s |
| 344 | H \x{17f}S |
| 345 | P (?i)\p{Lu}+ |
| 346 | H aBc |
| 347 | P (?i)\P{Lu}+ |
| 348 | Q (?i)[^\p{Lu}\p{Ll}\p{Lt}]+ |
| 349 | H aB1c; |
| 350 | P a(?i:b)c |
| 351 | H abc aBc abC |
| 352 | P (?i)a(?-i)b |
| 353 | H Ab AB ab |
| 354 | P (?i:a|b)c |
| 355 | H Ac Bc aC |
| 356 | P (?x) a \s+ b # comment |
| 357 | Q (?x) a \s+ b |
| 358 | H a b ab |
| 359 | P (?x) \d{2} - \d{2} |
| 360 | H 12-34 |
| 361 | P (?s:.)+ |
| 362 | H a\nb |
| 363 | P (?m:^b) |
| 364 | H a\nb |
| 365 | |
| 366 | # Escapes |
| 367 | P \x41\x{3bb}\u{3bc} |
| 368 | Q \x41\x{3bb}\x{3bc} |
| 369 | H xA\x{3bb}\x{3bc}y |
| 370 | P A\U0001F600 |
| 371 | Q \x{41}\x{1f600} |
| 372 | H A\x{1f600} |
| 373 | P \t\x{0A} |
| 374 | H a\t\nb |
| 375 | P \.\+\*\?\(\)\|\[\]\{\}\^\$\#\&\-\~ |
| 376 | Q \.\+\*\?\(\)\|\[\]\{\}\^\$\#\&\-\~ |
| 377 | H .+*?()|[]{}^$#&-~ |
| 378 | |
| 379 | # Multibyte haystacks |
| 380 | P \x{1f600}+ |
| 381 | H a\x{1f600}\x{1f600}b\x{1f600} |
| 382 | P \w+ |
| 383 | H \x{928}\x{92e}\x{938}\x{94d}\x{924}\x{947} \x{1f600}x |
| 384 | P . |
| 385 | H \x{1f600}\x{e9}a |
| 386 | P .\x{301} |
| 387 | H e\x{301} |