A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1329 ====================================================================== Reported By: rhialto Assigned To: ====================================================================== Project: 1003.1(2013)/Issue7+TC1 Issue ID: 1329 Category: Base Definitions and Headers Type: Clarification Requested Severity: Objection Priority: normal Status: New Name: Olaf 'Rhialto' Seibert 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 Line Number: 6195 Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2020-03-29 20:54 UTC Last Modified: 2020-11-09 17:06 UTC ====================================================================== Summary: Problem in resolution of https://austingroupbugs.net/view.php?id=793: "Regular Expressions: add REG_MINIMAL and a minimum repitition modifier" ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- child of 0000793 Regular Expressions: add REG_MINIMAL an... ======================================================================
---------------------------------------------------------------------- (0005111) geoffclare (manager) - 2020-11-09 17:06 https://austingroupbugs.net/view.php?id=1329#c5111 ---------------------------------------------------------------------- Draft 1.1 page 163 after line 5700 add:<blockquote><b>leftmost</b><blockquote>The characters closest to the beginning of the string.</blockquote></blockquote> Draft 1.1 page 172 lines 6090-6100 change:<blockquote><blockquote>Each of the duplication symbols ('+', '*', '?', and intervals) can be suffixed by the minimal repetition modifier '?' (<question-mark>), in which case matching behavior shall be changed from the leftmost longest possible match to the leftmost shortest possible match, including the null match (see Section A.9, on page 3410). For example, the ERE <tt>".*c"</tt> matches up to the last character (<tt>'c'</tt>) in the string <tt>"abc abc"</tt>, whereas the ERE <tt>".*?c"</tt> matches up to the first character <tt>'c'</tt>, the third character in the string. If the REG_MINIMAL flag, defined in the <b><regex.h></b> header, is used when compiling an ERE via <i>regcomp</i>( ), the leftmost shortest possible match shall be the default, and the minimal repetition modifier <tt>'?'</tt> can be used to select the leftmost longest possible match.</blockquote> The behavior of multiple adjacent duplication symbols ('+', '*', '?', and intervals, possibly suffixed by the minimal repetition modifier '?') produces undefined results.</blockquote>to:<blockquote><blockquote>Each of the duplication symbols ('+', '*', '?', and intervals) can be suffixed by the repetition modifier '?' (<question-mark>), in which case matching behavior for that repetition shall be changed from the leftmost longest possible match to the leftmost shortest possible match, including the null match (see Section A.9, on page 3410). For example, the ERE ".*c" matches up to and including the last character ('c') in the string "abc abc", whereas the ERE ".*?c" matches up to and including the first character 'c', the third character in the string. If the REG_MINIMAL flag, defined in the <b><regex.h></b> header, is used when compiling an ERE via <i>regcomp</i>( ), the leftmost shortest possible match shall be the default for all duplication symbols, and the repetition modifier '?' can be used to select the leftmost longest possible match for the repetition it modifies.</blockquote> The behavior of multiple adjacent duplication symbols ('+', '*', '?', and intervals, possibly suffixed by the repetition modifier '?') produces undefined results.</blockquote> Draft 1.1 page 163 line 5718-5722 after:<blockquote>Consistent with the whole match being the longest of the leftmost matches, each subpattern, from left to right, shall match the longest possible string. For this purpose, a null string shall be considered to be longer than no match at all. For example, matching the BRE "\(.*\).*" against "abcdef", the subexpression "(\1)" is "abcdef", and matching the BRE "\(a*\)*" against "bc", the subexpression "(\1)" is the null string.</blockquote>add:<blockquote>However, matching the ERE "(.*?).*" against "abcdef", the subpattern "(.*?)" matches the empty string, since that is the longest possible match for the ERE ".*?".</blockquote> Draft 1.1 page 1719 line 56518, change:<blockquote>REG_MINIMAL<blockquote>Change default matching behavior to leftmost shortest possible match.</blockquote></blockquote>to:<blockquote>REG_MINIMAL<blockquote>Change the matching behavior for duplication symbols to the leftmost shortest possible match, and invert the behavior of the repetition modifier '?' (<question-mark>) to match the longest possible match instead of the shortest.</blockquote></blockquote> Draft 1.1 page 3411 line 116717-116719 change:<blockquote>EREs can optionally use a leftmost-shortest rule (enabled via the REG_MINIMAL flag or the '?' minimal repetition modifier), in which case the shortest possible matching prefix is instead identified as the matching sequence.</blockquote>to:<blockquote>EREs can optionally use a leftmost-shortest rule for repetitions (enabled via the REG_MINIMAL flag or the '?' repetition modifier), in which case the shortest possible matching prefix is instead identified as the matching sequence for the affected repetition(s).</blockquote> Issue History Date Modified Username Field Change ====================================================================== 2020-03-29 20:54 rhialto New Issue 2020-03-29 20:54 rhialto Name => Olaf 'Rhialto' Seibert 2020-03-29 20:54 rhialto Section => Vol 1. 9.4.6, Vol. 1. 13. regex.h, Vol 2. regcomp(), Vol. 4. A.9.2 2020-03-29 20:54 rhialto Page Number => 190 2020-03-29 20:54 rhialto Line Number => 6195 2020-03-29 23:03 Don Cragun Relationship added child of 0000793 2020-03-30 02:57 kre Note Added: 0004804 2020-03-30 03:14 kre Note Added: 0004805 2020-03-30 03:23 kre Note Edited: 0004805 2020-03-30 05:59 kre Note Edited: 0004805 2020-03-30 08:36 geoffclare Note Added: 0004806 2020-03-30 10:27 kre Note Added: 0004808 2020-11-09 17:06 geoffclare Note Added: 0005111 ======================================================================