Overview
| Artifact ID: | c46649f0c4d170b50eaaf61ae6f26acb8bec26b4 |
|---|---|
| Ticket: | 219358ffffffffffffffffffffffffffffffffff
More info on the greedy/non-greedy problem (ticket 2866) |
| User & Date: | nobody on 2000-10-26 05:11:24 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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 - foundin changed to: "obsolete: 8.2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "43. Regexp"
- title changed to:
More info on the greedy/non-greedy problem (ticket 2866)
- type changed to: "Bug"