@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"],
});