babel-plugin-transform-es2015-unicode-regex
    Overview
    Documentation
    Code
    Playground
    Issues
    Insights
    Contributors
    Dependencies
    Versions
    Alternatives

babel-plugin-transform-es2015-unicode-regex

Compile ES2015 Unicode regex to ES5

6.24.1  •  Published 2 years ago  •  by hzoo  •  MIT License

Compile ES2015 unicode regex to ES5

Example

In

var string = "foo💩bar";
var match = string.match(/foo(.)bar/u);

Out

var string = "foo💩bar";
var match = string.match(/foo((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))bar/);

Installation

npm install --save-dev babel-plugin-transform-es2015-unicode-regex

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-es2015-unicode-regex"]
}

Via CLI

babel --plugins transform-es2015-unicode-regex script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-es2015-unicode-regex"]
});

Popularity

Weekly Downloads
2.3M

Maintenance

Development

Last ver 2 years ago
Created 4 years ago
Last commit 1 second ago
1 second between commits

Technology

Node version: 6.9.0
0 unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

0 contributors

Tags

babel-plugin