Artifacts Associated With Ticket 3d40c2da8175daba
Ticket change [d8e0dcf6ec] (rid 177284) by pooryorick on 2019-11-23 21:08:29:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
In the following example, the resulting indices are wrong: <code><verbatim> % regexp -indices -inline {(?:a*b)+c} aaaabbbbcc {0 8} </verbatim></code> The correct result should be: <code><verbatim> % regexp -indices -inline {(?:a*b)+c} aaaabbbbcc {7 8} </verbatim></code> - is_private initialized to: "0"
- login: "pooryorick"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "pooryorick"
- subsystem initialized to: "43. Regexp"
- title initialized to: "regexp (?:a*b)+c indices wrong"
- type initialized to: "Bug"
Ticket change [9dc7b84acc] (rid 177285) by sebres on 2019-11-24 15:25:35:
- closedate changed to: "2458812.14277741"
- closer changed to: "sebres"
- icomment:
No. Although the sub-expression traverses over all <code>a</code> (and finally over all <code>b</code> without <code>a</code>), despite this not capturing it as a group - the whole expression matches all characters to first <code>c</code> inclusive it. So the result <code>{0 8}</code> is pretty correct - <code>{0..4}</code> <code>aaaab</code> within first iteration by <code>a*b</code>, <code>{5..7}</code> <code>bbb</code> within second to 4th iteration by <code>(a*b)+</code> and then finally <code>{8}</code> <code>c</code>. Note that <code>(?:a*b)+</code> is neither a lookahead nor a lookbehind assertion (which is not implemented in tcl at all), so the whole match is captured for whole expression. How the iterations for first subexpression look, illustrating this example: <pre> % regexp -all -indices -inline {a*b} aaaabbbbcc {0 4} {5 5} {6 6} {7 7} </pre> - login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Invalid"
- status changed to: "Closed"