Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8e7feb7ea0bffe7378118704b8749f094c93f985
Ticket: 703709ffffffffffffffffffffffffffffffffff
'TCL_REG_CANMATCH' flag returns incorrect matches
User & Date: vincentdarley on 2003-03-14 16:23:11
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The attached patch to tclTest.c and reg.test shows 
    how Tcl_RegExpExecObj returns incorrect matches 
    for many, many cases using the 'TCL_CAN_MATCH' 
    flag.
    
    This flag is supposed to make regexp return (if it 
    can't find a complete match) the first possible 
    position at which a match could occur.  However, it 
    returns positions at which it is quite obvious no 
    match could ever occur!
    
    For example:
    
        set pat {.x}
        set line "asd asd"
        # can match the last char, if followed by x
        set res [testregexp -xflags -- c $pat $line resvar]
        lappend res $resvar
    
    Should return '0 6' to say there is no match (0) but 
    a match could possible occur at position 6 (with '.' 
    matching the final 'd', if an 'x' was to be appended 
    to the string).
    
    Unfortunately it returns '0 0' which is quite wrong.
    
    
  4. foundin changed to: "obsolete: 8.4.2"
  5. priority changed to: "6"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "vincentdarley"
  9. subsystem changed to: "43. Regexp"
  10. title changed to: "'TCL_CAN_MATCH' flag returns incorrect matches"
  11. type changed to: "Bug"