- Notifications
You must be signed in to change notification settings - Fork28
Commitcc39aca
committed
Fix similar_escape() so that SIMILAR TO works properly for patterns involving
alternatives ("|" symbol). The original coding allowed the added ^ and $constraints to be absorbed into the first and last alternatives, producinga pattern that would match more than it should. Per report from Eric Noriega.I also changed the pattern to add an ARE director ("***:"), ensuring thatSIMILAR TO patterns do not change behavior if regex_flavor is changed. Thisis necessary to make the non-capturing parentheses work, and seems like agood idea on general principles.Back-patched as far as 7.4. 7.3 also has the bug, but a fix seems impracticalbecause that version's regex engine doesn't have non-capturing parens.1 parentdcdf738 commitcc39aca
1 file changed
+29
-3
lines changedLines changed: 29 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
549 | 549 |
| |
550 | 550 |
| |
551 | 551 |
| |
552 |
| - | |
553 |
| - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
554 | 572 |
| |
555 | 573 |
| |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
556 | 578 |
| |
| 579 | + | |
| 580 | + | |
| 581 | + | |
557 | 582 |
| |
558 | 583 |
| |
559 | 584 |
| |
| |||
593 | 618 |
| |
594 | 619 |
| |
595 | 620 |
| |
| 621 | + | |
596 | 622 |
| |
597 | 623 |
| |
598 | 624 |
| |
|
0 commit comments
Comments
(0)