Commit d9d02c1
committed
Ban
PCRE, Oniguruma, and ICU allow `]` to appear as
the first member of a custom character class, and
treat it as literal, due to empty character classes
being invalid.
However this behavior isn't particularly intuitive,
and makes lexing heuristics harder to implement
properly. Instead, reject such character classes
as being empty, and require escaping if `]` is
meant as the first character.] as literal first character of custom character class1 parent 87ea119 commit d9d02c1
File tree
3 files changed
+10
-32
lines changed- Sources/_RegexParser/Regex/Parse
- Tests/RegexTests
3 files changed
+10
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | 468 | | |
479 | 469 | | |
480 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1282 | 1282 | | |
1283 | 1283 | | |
1284 | 1284 | | |
1285 | | - | |
1286 | 1285 | | |
1287 | 1286 | | |
1288 | 1287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 531 | + | |
548 | 532 | | |
549 | 533 | | |
550 | 534 | | |
| |||
2497 | 2481 | | |
2498 | 2482 | | |
2499 | 2483 | | |
2500 | | - | |
2501 | | - | |
2502 | | - | |
2503 | | - | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
2504 | 2493 | | |
2505 | 2494 | | |
2506 | 2495 | | |
| |||
0 commit comments