Overview
| Artifact ID: | 73755bb48fc6ecde7e5fd617647e1a1e6e99ab79 |
|---|---|
| Ticket: | 6585b21ca8fa6f3678d442b97241fdd43dba2ec0
Non-greedy match fails in combination with backreference |
| User & Date: | anonymous on 2013-07-18 23:03:22 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
This regexp test fails, though it should succeed: % regexp {(\w).*?\1} {Programmer} 0 If you remove the '?', it does succeed, showing that the problem is restricted to non-greedy mode. This problem was initially reported to the Postgres project: http://www.postgresql.org/message-id/CAM2+6=U8CdfM-qL55XHt+7hVzDRBnZwrHiVZRX2shGZ4OMuMSQ@mail.gmail.com As per the discussion there, it seems that this is a bug in cfindloop(), and that the fix is that the /* no point in trying again */ code block is wrong and should be replaced by a simple "break;", allowing the intermediate loop to continue iterating with the next possible "begin" value. I further suggested refactoring to merge that test into the subsequent statements that adjust estart/estop, but that's cosmetic, not essential to the fix. - foundin changed to: "8.5.8"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "26864b65f1c6ce8bda86f87ed9c554e19ac0390d"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "43. Regexp"
- title changed to:
Non-greedy match fails in combination with backreference
- type changed to: "Bug"