Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 994d059a5bcabf598e30ade0e0bababc33781c53
Ticket: 219374ffffffffffffffffffffffffffffffffff
non-greedy quantifiers break capturing parens
User & Date: nobody on 2000-10-26 05:11:48
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 5996 Bug
    Version: 8.4a1
    SubmitDate: '2000-07-10'
    LastModified: '2000-10-25'
    Severity: LOW
    Status: UnAssn
    Submitter: techsupp
    OS: Linux-Red Hat
    OSVersion: Tcl 8.3, 8.4a1, Windows 98 and RedHat Linux 6.x
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    Vadim Nasardinov
    
    ReproducibleScript:
    set str "start <s> continue <s> in both regexes, parens should capture up to here"
    
    regexp {.*<s>(.*)} $str match parens
    
    puts "
    Greedy match (works ok):
      match: >$match<
      parens: >$parens<
    "
    
    regexp {.*?<s>(.*)} $str match parens
    
    puts "
    Non-greedy match (p2 does not get set):
      match: >$match<
      parens: >$parens<
    "
    
    ObservedBehavior:
    Using a non-greedy quantifier causes breaks capturing parens.
    
    DesiredBehavior:
    The above code snippet should produce the following output:
    
    Greedy match (works ok):
      match: >start <s> continue <s> in both regexes, parens should capture up to here<
      parens: > in both regexes, parens should capture up to here<
    
    Non-greedy match (p2 does not get set):
      match: >start <s><
      parens: > continue <s> in both regexes, parens should capture up to here<
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.4a1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "non-greedy quantifiers break capturing parens"
  11. type changed to: "Bug"