Title
Is the value of the ECMA-262 RegExp object's multiline property really false?
Status
resolved
Section
[re.grammar]
Submitter
Nayuta Taga

Created on 2013-10-30.00:00:00 last changed 93 months ago

Messages

Date: 2016-08-08.15:33:15

Proposed resolution:

Resolved by LWG 2503.

Date: 2016-08-02.17:19:11

[ 2016-08 Chicago ]

Resolving 2503 will resolve this as well.

Date: 2015-05-15.00:00:00

[ 2015-05-22, Daniel comments ]

This issue interacts with LWG 2503.

Date: 2014-01-14.19:56:20

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 [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

History
Date User Action Args
2016-08-08 15:33:15adminsetmessages: + msg8462
2016-08-08 15:33:15adminsetstatus: ready -> resolved
2016-08-02 17:19:11adminsetmessages: + msg8327
2016-08-02 17:19:11adminsetstatus: new -> ready
2015-05-22 17:49:36adminsetmessages: + msg7423
2013-10-30 00:00:00admincreate