Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c08fbbcf6d8afce7d04593bc1a07daaf0ee3f0774e264ce2098226676bb017dd
Ticket: 524b35a8b5f9ec643fc323582217193d91247430
can't force regex subexpression greediness as stated by man page
User & Date: serhiy.storchaka on 2026-10-10 18:18:30
Changes

  1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
  2. icomment:
    Still the same in 8.6, 9.0 and 9.1: <tt>parseqatom()</tt> dropped every <tt>{1,1}</tt> as vacuous, so <tt>{1,1}?</tt> could not make a greedy atom non-greedy, and <tt>{1,1}</tt> could not make a non-greedy atom greedy (e.g. <tt>(.*?){1,1}(.*)</tt>), contrary to re_syntax.n.
    
    Proposed fix in branch [/timeline?r=regexp-1-1-quantifier-preference|regexp-1-1-quantifier-preference]: your patch, which keeps the quantifier when it asks for a different preference than the atom has. With it, the results agree with PostgreSQL on the example and on other <tt>{1,1}</tt> and <tt>{1}</tt> cases. Tests reg-25.4 to 25.9. Branch bug-524b35a8b5 had the same change without tests, based on core-8-5-branch.
    
  3. login: "serhiy.storchaka"
  4. mimetype: "text/x-fossil-wiki"