iterable-regexp-exec

1.1.0 • Public • Published

iterable-regexp-exec Build Status

Iterable interface for RegExp.prototype.exec()

Compatible with multiple other ES2015 features (e.g. spread operator, Array.from(), for..of).

Install

$ npm install --save iterable-regexp-exec

Usage

const iterableRegexpExec = require('iterable-regexp-exec');
 
const res = iterableRegexpExec(/[unicorns]/g, 'rainbows');
 
[...res].map(match => match[0]);
//=> ['r', 'i', 'n', 'o', 's']

API

iterableRegexpExec(regexp, string)

Yields regexp.exec(string) once per iteration.

regexp

Type: regexp

string

Type: boolean

License

MIT © Dmitriy Sobolev

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i iterable-regexp-exec

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • dsblv