Artifacts Associated With Ticket fe4fca32d
Ticket change [3b22e98da4] (rid 141456) by glennj on 2015-03-24 14:55:43:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Currently, the MATCHING section of the re_syntax man page talks about "preferences", and states: > A branch has the same preference as the first quantified atom in it which has a preference. I don't this this is sufficiently clear to illustrate the differences between $ perl -e 'if ("1234" =~ /(\d+?)(\d+)/) {print "$& $1 $2\n"}' 1234 1 234 $ echo 'puts [regexp -inline {(\d+?)(\d+)} "1234"]' | tclsh 12 1 2 Can we have an explicit statement? Something like: > If the first quantifier in a branch of a RE is non-greedy, /all/ quantifiers in the branch will be considered as non-greedy. However, I just noticed something I can't explain: what's the difference between these? $ echo 'puts [regexp -inline {(?:(\d+?)(\d+))} "1234"]' | tclsh 12 1 2 $ echo 'puts [regexp -inline {s+?|(?:(\d+?)(\d+))} "1234"]' | tclsh 1234 1 234 - foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "glennj"
- priority initialized to: "5 Medium"
- private_contact initialized to: "d3087a52abea86234116c6d0fc932ab13864ef48"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "glennj"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to:
mixed-greediness regular expressions need better documentation
- type initialized to: "Bug"
Ticket change [c30cd066c6] (rid 257598) by serhiy.storchaka on 2026-10-11 10:49:37:
- icomment:
Proposed docs fix in branch [/timeline?r=doc-re-syntax-preference|doc-re-syntax-preference]. It replaces the vague NOTE in re_syntax(n) MATCHING. The new text explains that the first quantified atom (or a top-level <code>|</code>) fixes only the length of the whole match, and that each quantifier keeps its own preference within that match. It covers your <code>s+?|(?:(\d+?)(\d+))</code> example, notes that this differs from Perl, Python and other engines, and shows how to work around it.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [9564d24721] (rid 261312) by dkf on 2026-11-08 20:52:56:
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "43. Regexp"
Ticket change [0437bd3e6e] (rid 261369) by oehhar on 2026-11-10 16:40:29:
- icomment:
Serhiy proposed to merge this with ticket [524b35a8b5].
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment: