Socket
Socket
Sign inDemoInstall

execall

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    execall

Find multiple RegExp matches in a string


Version published
Maintainers
1
Install size
14.6 kB
Created

Package description

What is execall?

The execall npm package is used to execute a regular expression against a string and return an array of matches, each with the matched text and index. It is particularly useful when you need to find all occurrences of a pattern in a string, not just the first one.

What are execall's main functionalities?

Finding multiple matches

This feature allows you to find all matches of a regular expression in a string. The example code searches for all occurrences of one or more digits in the given text and logs the array of match objects.

const execall = require('execall');
const regex = /\d+/g;
const matches = execall(regex, 'There are 3 apples and 5 oranges.');
console.log(matches);

Other packages similar to execall

Readme

Source

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

Keywords

FAQs

Last updated on 31 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc