ES2015 sticky regex transform

Compile ES2015 sticky regex to an ES5 RegExp constructor

安装

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

用法

通过 .babelrc(推荐)

.babelrc

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

通过 CLI

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

通过 Node API

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