Skip to content
Tcl Source Code History Of Ticket 1178541fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1178541fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1178541fffffffffffffffffffffffffffffffff

  1. Ticket change [0a30cbe007] (rid 113772) by wielemaker on 2005-04-07 13:37:44:

    1. assignee initialized to: "pvgoran"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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. foundin initialized to: "obsolete: 8.5a3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "wielemaker"
    9. subsystem initialized to: "43. Regexp"
    10. title initialized to: "REG_BOSONLY incorrect with |"
    11. type initialized to: "Bug"
  2. Ticket change [4bd0e230d5] (rid 126772) by wielemaker on 2005-04-07 21:42:00:

    1. icomment:
      Logged In: YES 
      user_id=1222641
      
      After a bit if hacking I came up with the following patch. 
      Its not
      tested very much, but it does run the fairly limited test
      set I have.
      Note that the lines may be shifted a bit as I made some more
      modifications to interface the code with the rest of the
      environment,
      
          Cheers --- Jan
      
      
    2. login: "wielemaker"
    3. mimetype: "text/plain"
    4. username: "wielemaker"
  3. Ticket change [1849538ed5] (rid 122633) by wielemaker on 2005-04-07 21:42:01:

    1. icomment:
      
      
      File Added - 128932: x
      
      
      
    2. login: "wielemaker"
    3. mimetype: "text/plain"
    4. username: "wielemaker"
  4. Add attachment "x" [4e1975ff9e] (rid 127167) by wielemaker on 2005-04-07 21:42:01.

  5. Add attachment "bosonly.patch" [ca8a8c6e68] (rid 143836) by tgl on 2015-11-06 22:10:40.

  6. Ticket change [cae79199d9] (rid 143837) by tgl on 2015-11-06 22:14:19:

    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"
  7. Ticket change [70a24ce841] (rid 257585) by serhiy.storchaka on 2026-10-11 08:46:45:

    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-bosonly-alternatives|regexp-bosonly-alternatives]: the patch by tgl below. With it, all alternatives are anchored, and the results agree with <tt>\A(?:re)</tt>, also with <tt>TCL_REG_NOTBOL</tt>. Test reg-30.9.
      
      Expect does not use <tt>TCL_REG_BOSONLY</tt> any more (it only passes <tt>TCL_REG_ADVANCED</tt> and <tt>TCL_REG_NOCASE</tt>); in Tcl itself only <tt>testregexp</tt> uses it. The flag is kept for other users of <tt>tclInt.h</tt>.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"
  8. Ticket change [9b479c9219] (rid 257898) by jan.nijtmans on 2026-10-13 12:22:17:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2461327.0154756946"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Merged to [a712586c65|trunk], core-9-0-branch and core-8-6-branch
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"