Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cae79199d95051c86a9019145b5bc8ecff515be7
Ticket: 1178541fffffffffffffffffffffffffffffffff
REG_BOSONLY incorrect with |
User & Date: tgl on 2015-11-06 22:14:19
Changes

  1. assignee changed to: "aku"
  2. closer changed to: "nobody"
  3. comment changed to:
    Hi,
    
    I've incorporated the Tcl regex code in my project
    (www.swi-prolog.org) and found a bug in the regex
    code.  I guess that will also affect Tcl.  I didn't
    find a patch yet, I have some trouble sorting out the
    internals.
    
    In my app it shows as
    
    ?-send(regex('foo|bar'), match, 'xxx bar').
    
    which succeeds!
    
    Match (instead of search) sets REG_BOSONLY, but this causes
    the regex to be read as \Afoo|bar rather than \A(foo|bar).
    
    Using foo|\Abar, all works fine as well.
    
          Cheers --- Jan
    
  4. icomment:
    The complained-of behavior certainly seems to be a bug, but I do not like Jan's proposed fix much --- it's taking an implementation that was a kluge to start with and making it even more messy.  I suggest the attached instead, which works by not generating arcs corresponding to the forbidden cases to begin with.
    
    Another idea worth considering is to remove REG_BOSONLY altogether ... does anyone know if Expect still uses it?
    
  5. login: "tgl"
  6. mimetype: "text/plain"
  7. severity changed to: "Minor"