Skip to content
Tcl Source Code History Of Ticket 3d40c2da8175daba
Login

History Of Ticket 3d40c2da8175daba

Artifacts Associated With Ticket 3d40c2da8175daba

  1. Ticket change [d8e0dcf6ec] (rid 177284) by pooryorick on 2019-11-23 21:08:29:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. 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>
      
    5. is_private initialized to: "0"
    6. login: "pooryorick"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Important"
    10. status initialized to: "Open"
    11. submitter initialized to: "pooryorick"
    12. subsystem initialized to: "43. Regexp"
    13. title initialized to: "regexp (?:a*b)+c indices wrong"
    14. type initialized to: "Bug"
  2. Ticket change [9dc7b84acc] (rid 177285) by sebres on 2019-11-24 15:25:35:

    1. closedate changed to: "2458812.14277741"
    2. closer changed to: "sebres"
    3. 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>
      
    4. login: "sebres"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"