Artifacts Associated With Ticket 1178541fffffffffffffffffffffffffffffffff
Ticket change [0a30cbe007] (rid 113772) by wielemaker on 2005-04-07 13:37:44:
- assignee initialized to: "pvgoran"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "obsolete: 8.5a3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "wielemaker"
- subsystem initialized to: "43. Regexp"
- title initialized to: "REG_BOSONLY incorrect with |"
- type initialized to: "Bug"
Ticket change [4bd0e230d5] (rid 126772) by wielemaker on 2005-04-07 21:42:00:
- 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 - login: "wielemaker"
- mimetype: "text/plain"
- username: "wielemaker"
- icomment:
Ticket change [1849538ed5] (rid 122633) by wielemaker on 2005-04-07 21:42:01:
- icomment:
File Added - 128932: x
- login: "wielemaker"
- mimetype: "text/plain"
- username: "wielemaker"
- icomment:
Add attachment "x" [4e1975ff9e] (rid 127167) by wielemaker on 2005-04-07 21:42:01.
Add attachment "bosonly.patch" [ca8a8c6e68] (rid 143836) by tgl on 2015-11-06 22:10:40.
Ticket change [cae79199d9] (rid 143837) by tgl on 2015-11-06 22:14:19:
- assignee changed to: "aku"
- closer changed to: "nobody"
- 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 - 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?
- login: "tgl"
- mimetype: "text/plain"
- severity changed to: "Minor"
Ticket change [70a24ce841] (rid 257585) by serhiy.storchaka on 2026-10-11 08:46:45:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- 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>.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
Ticket change [9b479c9219] (rid 257898) by jan.nijtmans on 2026-10-13 12:22:17:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461327.0154756946"
- closer changed to: "jan.nijtmans"
- icomment:
Merged to [a712586c65|trunk], core-9-0-branch and core-8-6-branch
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"