2330. regex("meow", regex::icase) is technically forbidden but should be permitted

Section: 28.6.4.2 [re.synopt] Status: C++14 Submitter: Stephan T. Lavavej Opened: 2013-09-21 Last modified: 2017-07-05

Priority: 0

View all other issues in [re.synopt].

View all issues with C++14 status.

Discussion:

28.6.4.2 [re.synopt]/1 says "A valid value of type syntax_option_type shall have exactly one of the elements ECMAScript, basic, extended, awk, grep, egrep, set."

This "exactly one" wording technically forbids passing icase by itself! Users should not be required to pass regex::ECMAScript | regex::icase. (Note that the cost of an additional check for no grammar being explicitly requested is completely irrelevant, as regex construction is so much more expensive.)

[Issaquah 2014-02-11: Move to Immediate]

Proposed resolution:

This wording is relative to N3691.

  1. Edit 28.6.4.2 [re.synopt] as indicated:

    -1- The type syntax_option_type is an implementation-defined bitmask type (17.5.2.1.3). Setting its elements has the effects listed in table 138. A valid value of type syntax_option_type shall have exactlyat most one of the grammar elements ECMAScript, basic, extended, awk, grep, egrep, set. If no grammar element is set, the default grammar is ECMAScript.