@babel/plugin-transform-sticky-regex

Examples

In

  1. const a = /o+/y;

Out

  1. var a = new RegExp("o+", "y");

Installation

  1. npm install --save-dev @babel/plugin-transform-sticky-regex

Usage

  1. {
  2. "plugins": ["@babel/plugin-transform-sticky-regex"]
  3. }

Via CLI

  1. babel --plugins @babel/plugin-transform-sticky-regex script.js

Via Node API

  1. require("@babel/core").transform("code", {
  2. plugins: ["@babel/plugin-transform-sticky-regex"]
  3. });