regexp-polyfill

1.0.1 • Public • Published

Polyfill RegExp to support named captures

Tested on IE 10+

Install

npm i regexp-polyfill --save

Documentation

upcoming-regexp-features

WARN The polyfill only works when creating RegExp with new. The syntax /pattern/flagswon't work !

Currently only named captures are polyfilled.

Example:

const pattern = new RegExp(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}));
const result = pattern.exec('2017-07-10');
// result.groups.year === '2017'
// result.groups.month === '07'
// result.groups.day === '10'

Readme

Keywords

none

Package Sidebar

Install

npm i regexp-polyfill

Weekly Downloads

862

Version

1.0.1

License

MIT

Unpacked Size

12.9 kB

Total Files

4

Last publish

Collaborators

  • lifaon74