babel/packages/babel-plugin-transform-dotall-regex

@babel/plugin-transform-dotall-regex

Compile regular expressions using the s (dotAll) flag to ES5 that works in todays environments.

Example

In

/./s

Out

/[\0-\uFFFF]/

In

/./su

Out

/[\0-\u{10FFFF}]/u

Heres an online demo.

Installation

npm install --save-dev @babel/plugin-transform-dotall-regex

Usage

.babelrc

{
  "plugins": ["@babel/plugin-transform-dotall-regex"]
}

Via CLI

$ babel --plugins @babel/plugin-transform-dotall-regex script.js

Via Node.js API

require('@babel/core').transform(code, {
  'plugins': ['@babel/plugin-transform-dotall-regex']
});

Author

twitter/mathias
Mathias Bynens