Anonymous | Login | 2024-10-15 00:58 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0000793 | [1003.1(2013)/Issue7+TC1] Base Definitions and Headers | Editorial | Enhancement Request | 2013-11-15 14:37 | 2024-06-11 09:02 | ||
Reporter | steffen | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Accepted | ||||
Status | Closed | ||||||
Name | steffen | ||||||
Organization | |||||||
User Reference | |||||||
Section | Vol 1. 9.4.6, Vol. 1. 13. regex.h, Vol 2. regcomp(), Vol. 4. A.9.2 | ||||||
Page Number | 190, 322, 1783, 3501 | ||||||
Line Number | 6195, 10781, 57428, 118310 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | |||||||
Summary | 0000793: Regular Expressions: add REG_MINIMAL and a minimum repitition modifier | ||||||
Description |
The current POSIX regular expressions only offer a very restricted set of functionality, which forces many, if not most, real-life programs to use external regular expressions libraries which add features like non-greediness, positive and negative lookaround assertions and Unicode compatibility. Some Open Group members already ship with regular expression facilities which support at least some of the extensions, and there exist long-proven, stable and free (also for commercial use, BSD-licensed), almost drop-in, alternatives which can be used by the others (see the mailing list for some references). |
||||||
Desired Action |
- Vol. 1: Base Definitions, Chapter 9, «Regular Expressions». 9.4.6 EREs Matching Multiple Characters, p. 190, line 6195: insert after 6. Each of the duplication symbols (’+’, ’*’, ’?’, and intervals) may be suffixed by the minimal repitition modifier ’?’ <question-mark>, in which case matching behaviour is changed from the «leftmost longest possible match» to the «leftmost shortest possible match», including the null match (see [reference to A.9, p. 3500 ff.]). For example, the ERE ".*c" matches the last character (’c’) in the string "abc abc", whereas the ERE ".*?c" matches the first character ’c’, the third character in the string. If the REG_MINIMAL flag, as defined in the <regex.h>[REF] header, is used when compiling an ERE via regcomp(3)[REF], the «leftmost shortest possible match» is the default, and the minimal repitition modifier ’?’ can be used to select the «leftmost longest possible match». change, on (current) line 6195 ff., The behavior of multiple adjacent duplication symbols (’+’, ’*’, ’?’, and intervals) produces undefined results. to The behavior of multiple adjacent duplication symbols (’+’, ’*’, ’?’, and intervals, possibly suffixed by the minimal repitition modifier) produces undefined results. - Vol. 1: Base Definitions, Chapter 13, «Headers». On p. 322, line 10781 insert after REG_MINIMAL Change default matching behaviour to »leftmost shortest possible match». Only applicable to REG_EXTENDED regular expressions. - Vol. 2: System Interfaces. On p. 1783, line 57428 insert after REG_MINIMAL Change default matching behaviour to »leftmost shortest possible match». Only applicable to REG_EXTENDED regular expressions. - Vol. 4: Rationale (Informative), A.9.2 «Regular Expression General Requirements». On p. 3501, line 118310 insert after EREs can optionally use a «leftmost-shortest» rule (enabled via the REG_MINIMAL flag and/or the ’?’ minimal repitition modifier), in which case the «shortest possible matching prefix» is instead identified as the matching sequence. |
||||||
Tags | issue8 | ||||||
Attached Files | |||||||
|
Relationships | ||||||
|
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |