Artifacts Associated With Ticket 219358
Ticket change [c46649f0c4] (rid 111842) by nobody on 2000-10-26 05:11:24:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 5865 Bug Version: 8.2 SubmitDate: '2000-06-08' LastModified: '2000-06-21' Severity: MED Status: UnAssn Submitter: techsupp ChangedBy: ericm OS: SunOS OSVersion: SunOS beast 5.7 Generic_106541-09 sun4u sparc SUNW,Ultra-4 Machine: It's not mine, it's ArsDigita's, and I know nothing about it. FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Ian Baker Extensions: I have no clue. It's running inside AOLserver, if that helps at all. ReproducibleScript: % regexp "(.+?)(.+?)(.{2,4})(.+?)(.+)" "abcdefghijklm" match a b c d e 1 % puts "$a:$b:$c:$d:$e" a:b:cd:e:f ObservedBehavior: If the first quantifier is non-greedy, the RE matches "non-greedy only", as is described in ticket #2866. If the first quantifier is greedy, however, the RE no longer matches either "greedy or non-greedy, but not some mixture of the two": it begins to work as expected. DesiredBehavior: Here's an RE that mixes greedy and non-greedy quantifiers, yet works as expected, mixing the two. (note that the 1st, 3rd and 5th subexpressions match greedy, while the 2nd and 4th do not) % regexp "(.?)(.+?)(.{2,4})(.+?)(.+)" "abcdefghijklm" match a b c d e 1 % puts "$a:$b:$c:$d:$e" a:b:cdef:g:hijklm - foundin initialized to: "obsolete: 8.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "43. Regexp"
- title initialized to:
More info on the greedy/non-greedy problem (ticket 2866)
- type initialized to: "Bug"
Ticket change [4196b5cb37] (rid 116218) by dkf on 2000-11-10 17:43:41:
- foundin changed to: "obsolete: 8.3.2"
- icomment:
Behaviour is confirmed in 8.3.2
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [e71f9c3f0a] (rid 104398) by dgp on 2003-11-13 05:18:09:
- assignee changed to: "pvgoran"
Ticket change [aa0e92ccf5] (rid 157327) by dram on 2017-10-26 01:42:08:
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
OriginalBugID: 5865 Bug Version: 8.2 SubmitDate: '2000-06-08' LastModified: '2000-06-21' Severity: MED Status: UnAssn Submitter: techsupp ChangedBy: ericm OS: SunOS OSVersion: SunOS beast 5.7 Generic_106541-09 sun4u sparc SUNW,Ultra-4 Machine: It's not mine, it's ArsDigita's, and I know nothing about it. FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Ian Baker Extensions: I have no clue. It's running inside AOLserver, if that helps at all. ReproducibleScript: % regexp "(.+?)(.+?)(.{2,4})(.+?)(.+)" "abcdefghijklm" match a b c d e 1 % puts "$a:$b:$c:$d:$e" a:b:cd:e:f ObservedBehavior: If the first quantifier is non-greedy, the RE matches "non-greedy only", as is described in ticket #2866. If the first quantifier is greedy, however, the RE no longer matches either "greedy or non-greedy, but not some mixture of the two": it begins to work as expected. DesiredBehavior: Here's an RE that mixes greedy and non-greedy quantifiers, yet works as expected, mixing the two. (note that the 1st, 3rd and 5th subexpressions match greedy, while the 2nd and 4th do not) % regexp "(.?)(.+?)(.{2,4})(.+?)(.+)" "abcdefghijklm" match a b c d e 1 % puts "$a:$b:$c:$d:$e" a:b:cdef:g:hijklm - icomment:
Related to 1. https://core.tcl.tk/tcl/tktview?name=219219ffff 2. https://core.tcl.tk/tcl/tktview?name=2798939fff
- login: "dram"
- mimetype: "text/plain"
- severity changed to: "Minor"
Ticket change [a8073aaeef] (rid 257599) by serhiy.storchaka on 2026-10-11 10:49:37:
- icomment:
Both results follow re_syntax(n) MATCHING. The first quantified atom sets only the length of the whole match. Within that match, each subexpression takes the longest or shortest substring according to its own quantifier, earlier ones first, which is why the second RE looks "mixed". The docs are clarified in branch [/timeline?r=doc-re-syntax-preference|doc-re-syntax-preference]. Duplicate of [219219ffff].
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [ced3d11160] (rid 257605) by serhiy.storchaka on 2026-10-11 10:52:40:
- login: "serhiy.storchaka"
- resolution changed to: "Duplicate"
- status changed to: "Closed"
Ticket change [373270c3d2] (rid 259883) by serhiy.storchaka on 2026-10-22 17:19:24:
- closedate changed to: "2461324.953250139"
- closer changed to: "serhiy.storchaka"
- login: "serhiy.storchaka"