Skip to content

ES6 regular expressions unicode mode: case insensitivity case folding inconsistency #5948

@vsemozhetbyt

Description

@vsemozhetbyt
  • Version: 5.9.1
  • Platform: Windows 64-bit

Here is a good article on the topic with this code example:

var es5regex = /\W/i;
var es6regex = /\W/iu;
console.log(
  es5regex.test('☃'),     es6regex.test('☃'),      // true true
  es5regex.test('S'),      es6regex.test('S'),      // false true
  es5regex.test('\u017F'), es6regex.test('\u017F'), // true true
  es5regex.test('K'),      es6regex.test('K'),      // false true
  es5regex.test('\u212A'), es6regex.test('\u212A')  // true true
);

(https://mathiasbynens.be/notes/es6-unicode-regex#impact-i)

The last Chrome Canary with V8 5.1.216 gives the same output.

However the 5.9.1 Node with --harmony-unicode-regexps and V8 4.6.85.31 gives this one:

true true
false false
true true
false false
true true

Is this temporary inconsistency while the 'u' flag is feature in progress?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that look for answers.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions