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

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

Here’s an online demo.

Installation

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

Usage

With a configuration file (Recommended)

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

Via CLI

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

Via Node.js API

require("@babel/core").transform(code, {
  "plugins": ["@babel/plugin-proposal-unicode-property-regex"]
});

To transpile to ES6/ES2015:

require("@babel/core").transform(code, {
  "plugins": [
    ["@babel/plugin-proposal-unicode-property-regex", { "useUnicodeFlag": false }]
  ]
});

Options

  • useUnicodeFlag (defaults to true)

When disabled with false, the transform converts Unicode regexes to non-Unicode regexes for wider support, removing the u flag. See https://github.com/mathiasbynens/regexpu-core#useunicodeflag-default-false for more information.

You can read more about configuring plugin options here

Author

twitter/mathias
Mathias Bynens
  • Installation
  • Usage
    • With a configuration file (Recommended)
    • Via CLI
    • Via Node.js API
  • Options
  • Author
Babel
Docs
Learn ES2015
Community
VideosUser ShowcaseStack OverflowSlack ChannelTwitter
More
BlogGitHub OrgGitHub RepoWebsite RepoOld 6.x SiteOld 5.x Site