Babel
  • Docs
  • Setup
  • Try it out
  • Videos
  • Blog
  • Donate
  • Team
  • GitHub
Edit

@babel/plugin-proposal-unicode-sets-regex

This plugin transforms regular expressions using the v flag, introduced by the RegExp set notation + properties of strings proposal, to regular expressions that use the u flag.

Example

/[\p{ASCII}&&\p{Decimal_Number}]/v

will be transformed to

/[0-9]/u

Installation

npm install --save-dev @babel/plugin-proposal-unicode-sets-regex

Usage

With a configuration file (Recommended)

{
  "plugins": ["@babel/plugin-proposal-unicode-sets-regex"]
}

Via CLI

babel --plugins @babel/plugin-proposal-unicode-sets-regex script.js

Via Node API

require("@babel/core").transformSync("code", {
  plugins: ["@babel/plugin-proposal-unicode-sets-regex"],
});
  • Example
  • Installation
  • Usage
    • With a configuration file (Recommended)
    • Via CLI
    • Via Node API
Babel
Docs
Learn ES2015
Community
VideosUser ShowcaseStack OverflowSlack ChannelTwitter
More
BlogGitHub OrgGitHub RepoWebsite RepoOld 6.x SiteOld 5.x Site