1.0.1 • Published 6 years ago

regexp-polyfill v1.0.1

Weekly downloads
798
License
MIT
Repository
github
Last release
6 years ago

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'
1.0.1

6 years ago

1.0.0

6 years ago

0.1.1

7 years ago

0.1.0

7 years ago