Created on 2014-02-01.00:00:00 last changed 130 months ago
Proposed resolution:
This wording is relative to N3797.
Apply the following edit to the table in [re.synopt]/1
Specifies that no sub-expressions shall be considered to be marked, so that when a regular expression is matched against a character container sequence, no sub-expression matches shall be stored in the supplied match_results structure.
[ Issaquah 2014-02-12: Move to Immediate ]
As discussed in c++std-lib-35399 and its replies, I can see two possible interpretations of the effects of regex_constants::nosubs:
The effect of nosubs only applies during matching. Parentheses are still recognized as marking a sub-expression by the basic_regex compiler, and basic_regex::mark_count() still returns the number of marked sub-expressions, but anything they match is not stored in the results. This means it is not always true that results.size() == r.mark_count() + 1 for a successful match.
nosubs affects how a regular expression is compiled, altering the state of the std::basic_regex object so that mark_count() returns zero. This also affects any subsequent matching.
The definition of nosubs should make this clear.
The wording in [re.synopt]/1 seems to imply that nosubs only has effects during matching, which is (1), but all known implementations do (2). John Maddock confirmed that (2) was intended.History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-27 17:03:20 | admin | set | status: wp -> c++14 |
2014-02-20 13:52:38 | admin | set | status: immediate -> wp |
2014-02-13 06:35:03 | admin | set | messages: + msg6839 |
2014-02-13 06:35:03 | admin | set | status: new -> immediate |
2014-02-01 21:25:54 | admin | set | messages: + msg6806 |
2014-02-01 00:00:00 | admin | create |