This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

2503. multiline option should be added to syntax_option_type

Section: 32.4.2 [re.synopt] Status: C++17 Submitter: Nozomu Katō Opened: 2015-05-22 Last modified: 2017-07-30

Priority: 2

View all other issues in [re.synopt].

View all issues with C++17 status.

Discussion:

The specification of ECMAScript defines the Multiline property for its RegExp and the regular expressions ^ and $ behave differently according to the value of this property. Thus, this property should be available also in the ECMAScript compatible engine in std::regex.

[2015-05-22, Daniel comments]

This issue interacts somewhat with LWG 2343.

[Telecon 2015-07]

Set the priority to match LWG 2343.

[2016-08, Chicago]

Monday PM: Moved to Tentatively Ready. This also resolves 2343

Proposed resolution:

This wording is relative to N4431.

  1. Change 32.4.2 [re.synopt] as indicated:

    namespace std::regex_constants {
      typedef T1 syntax_option_type;
      constexpr syntax_option_type icase = unspecified ;
      constexpr syntax_option_type nosubs = unspecified ;
      constexpr syntax_option_type optimize = unspecified ;
      constexpr syntax_option_type collate = unspecified ;
      constexpr syntax_option_type ECMAScript = unspecified ;
      constexpr syntax_option_type basic = unspecified ;
      constexpr syntax_option_type extended = unspecified ;
      constexpr syntax_option_type awk = unspecified ;
      constexpr syntax_option_type grep = unspecified ;
      constexpr syntax_option_type egrep = unspecified ;
      constexpr syntax_option_type multiline = unspecified ;
    }
    
  2. Change 32.4.3 [re.matchflag], Table 138 — "syntax_option_type effects" as indicated:

    Table 138 — syntax_option_type effects
    Element Effect(s) if set
    multiline Specifies that ^ shall match the beginning of a line and $ shall match the end of a line, if the ECMAScript engine is selected.