2343. Is the value of the ECMA-262 RegExp object's multiline property really false?

Section: 31.13 [re.grammar] Status: Resolved Submitter: Nayuta Taga Opened: 2013-10-30 Last modified: 2017-03-13

Priority: 2

View other active issues in [re.grammar].

View all other issues in [re.grammar].

View all issues with Resolved status.

Discussion:

In the following "Multiline" is the value of the ECMA-262 RegExp object's multiline property.

In ECMA-262, there are some definitions that relate to Multiline:

So, the C++11 standard says that Multiline is false. As it is false, ^ matches only the beginning of the string, and $ matches only the end of the string.

However, two flags are defined in 31.5.2 [re.matchflag] Table 139:

match_not_bol: the character ^ in the regular expression shall not match [first,first).

match_not_eol: the character "$" in the regular expression shall not match [last,last).

As Multiline is false, the match_not_bol and the match_not_eol are meaningless because they only make ^ and $ match none.

In my opinion, Multiline should be true.

FYI, Multiline of the existing implementations are as follows:

Multiline=false:

Multiline=true:

[2015-05-22, Daniel comments]

This issue interacts with LWG 2503.

[2016-08 Chicago]

Resolving 2503 will resolve this as well.

Proposed resolution:

Resolved by LWG 2503.