Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7a42f695cd723c8a1e40d8b1e92293afece2a6d274dad5733cbb240b1c80a395
Ticket: 5ea71fdcd3291c38dff80d6ccdaf30f4969316e4
Regexp fails to enforce LACON restrictions inside nested parentheses
User & Date: serhiy.storchaka on 2026-10-11 08:04:06
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.
    
    Proposed fix in branch [/timeline?r=regexp-lacon-nested-parens|regexp-lacon-nested-parens]: your patch. Both examples now behave as in PostgreSQL: the first one gives "invalid backreference number", the second one matches <tt>x</tt> without submatches. Tests reg-6.21 to 6.24.
    
    <b>This is a breaking change.</b> Parentheses nested in a lookahead constraint no longer count as capturing, so the following subexpressions are renumbered, and REs with a backref inside a lookahead constraint no longer compile. Both are what re_syntax.n has always documented, but existing code may rely on the old behaviour. Code that used non-capturing groups <tt>(?:...)</tt> inside lookahead constraints, the workaround for this bug, is not affected.
    
  3. login: "serhiy.storchaka"
  4. mimetype: "text/x-fossil-wiki"