Détail du package

regexp-polyfill

lifaon743kMIT1.0.1

Polyfill RegExp : Named capture

readme

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'