Artifacts Associated With Ticket 75c9d9cece561240
Ticket change [81796d5021] (rid 195481) by tgl on 2021-08-23 16:04:19:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
$ tclsh % regexp {^(.)\1|\1.} {abcdef} 1 % regexp {^((.)\2|..)\2} {abadef} 1 Of course, neither of these should match, because the (.) capture is within a failed alternative branch, so the last backref to it should be deemed unable to match. Analysis and fix for it in Postgres is here: https://www.postgresql.org/message-id/151435.1629733387%40sss.pgh.pa.us I doubt you can use the code change exactly as-is, because I don't think you ever adopted our changes to create an explicit "iteration" subre type. But the principle, and particularly the more careful specification of cdissect's recursion rules, should still work for you. - foundin initialized to: "8.6.8"
- is_private initialized to: "0"
- login: "tgl"
- priority initialized to: "5 Medium"
- private_contact initialized to: "26864b65f1c6ce8bda86f87ed9c554e19ac0390d"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "tgl"
- subsystem initialized to: "43. Regexp"
- title initialized to:
regexp sometimes allows an invalid backref to be matched
- type initialized to: "Bug"
Ticket change [49e6151252] (rid 257509) by serhiy.storchaka on 2026-10-10 19:29:32:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- icomment:
Still the same in 8.6, 9.0 and 9.1. When the right side of a concatenation failed, <tt>ccondissect()</tt> and <tt>crevcondissect()</tt> left the captures of the left side set, so the next alternative's backref saw them. Proposed fix in branch [/timeline?r=regexp-backref-failed-alt|regexp-backref-failed-alt]: your PostgreSQL change, which clears the left side's captures when the right side fails and defines the cdissect() rules for clearing match data. Tests reg-14.30 and 14.31 (your examples).
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
Ticket change [32c83197f2] (rid 257630) by jan.nijtmans on 2026-10-11 16:50:48:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461325.2019482525"
- closer changed to: "jan.nijtmans"
- icomment:
Fixed in [9383b0c913592380|trunk], core-9-0-branch and core-8-6-branch Many thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"