Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 563771520af3f31c5ff746bc99afe9dc6902ed23
Ticket: 5ea71fdcd3291c38dff80d6ccdaf30f4969316e4
Regexp fails to enforce LACON restrictions inside nested parentheses
User & Date: tgl on 2015-11-07 18:31:03
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Per the manual, backrefs are not allowed inside lookahead constraints, and all parentheses therein are considered non-capturing.  But the regexp parser forgets these restrictions when it recurses to enter a parenthesized subexpression inside a LACON.  So we get silliness like this (tested with 8.6.4):
    
    % regexp -inline {x(\w)(?=(\1))} {xyz}
    xy y
    % regexp -inline {x(?=((foo)))} {xfoobar}
    x {}
    
    Fix is a one-liner, see attached patch, which is a Tcl-ified version of
    http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=a43b4ab1111ca5e5f40a2ddd8e56bf999b9fdad9
    
  5. foundin changed to: "8.6.4"
  6. is_private changed to: "0"
  7. login: "tgl"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "26864b65f1c6ce8bda86f87ed9c554e19ac0390d"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "tgl"
  14. subsystem changed to: "43. Regexp"
  15. title changed to:
    Regexp fails to enforce LACON restrictions inside nested parentheses
    
  16. type changed to: "Bug"