1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-06 20:28:20 -05:00
notes/node_modules/execall
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
index.js Initial commit 2017-03-09 13:16:08 -05:00
license Initial commit 2017-03-09 13:16:08 -05:00
package.json Initial commit 2017-03-09 13:16:08 -05:00
readme.md Initial commit 2017-03-09 13:16:08 -05:00

execall Build Status

Find multiple RegExp matches in a string

Instead of having to iterate over RegExp#exec, immutable, and with a nicer result format.

Install

$ npm install --save execall

Usage

var execall = require('execall');

execall(/(\d+)/g, '$200 and $400');
/*
[
	{
		match: '200',
		sub: ['200'],
		index: 1
	},
	{
		match: '400',
		sub: ['400'],
		index: 10
	}
]
*/

API

execall(re, input)

Returns an array of objects with a match, sub-matches, and index.

re

Type: regexp

Regular expression to match against the input.

input

Type: string

License

MIT © Sindre Sorhus