View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002007 | 1003.1(2024)/Issue8 | Base Definitions and Headers | public | 2026-11-18 20:29 | 2026-11-18 23:36 |
| Reporter | nsz | Assigned To | |||
| Priority | normal | Severity | Editorial | Type | Clarification Requested |
| Status | New | Resolution | Open | ||
| Name | Szabolcs Nagy | ||||
| Organization | musl | ||||
| User Reference | |||||
| Section | 9.1 Regular Expression Definitions | ||||
| Page Number | 179 | ||||
| Line Number | 6357 | ||||
| Interp Status | |||||
| Final Accepted Text | |||||
| Summary | 0002007: regular expression repetition modifier '?' in case of no match | ||||
| Description | new text in https://austingroupbugs.net/view.php?id=1857#c7130 2. If an ERE contains repetitions with and without the repetition modifier '?', the precedence between the repetitions shall be: a. Each leftmost shortest match shall match the leftmost shortest sequence in the string, in descending priority from left to right. ... ... the ERE "(aaa??)*" matches only the first four characters of the string "aaaaa", ... my reading of 2a implies "(aaa??)*" matches "aaaaa" as (0,0)(-1,-1) and not (0,4)(2,4). because a no match (of a??) is more "leftmost shortest" compared to an empty match. to consider further rules we need to establish that they are equally "leftmost shortest", but i did not find text for that. i.e. if a no match is shorter than an empty match then "(a|aaa??)" only matches the first "a" in "aa". | ||||
| Desired Action | clarify that in 2a a no match is not better than an empty (0 repetition) match (but equal, so further rules apply). | ||||
| Tags | No tags attached. | ||||