This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.
Section: 32.12 [re.grammar] Status: Resolved Submitter: Nayuta Taga Opened: 2013-10-30 Last modified: 2017-03-12
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:ECMA-262 15.10.2.6:
If Multiline is true, ^ matches just after LineTerminator.
If Multiline is false, ^ does not match just after LineTerminator. If Multiline is true, $ matches just before LineTerminator. If Multiline is false, $ does not match just before LineTerminator.
ECMA-262 15.10.4.1, 15.10.7.4:
By default, Multiline is false.
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 32.4.3 [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:libstdc++ r206594
libc++ r199174
Multiline=true:
Visual Studio Express 2013
boost 1.55
[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.