
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
Find multiple RegExp matches in a string
Instead of having to iterate over RegExp#exec, immutable, and with a nicer result format.
$ npm install execall2
import execall from 'execall2';
import * as execall from 'execall2';
import { execall } from 'execall2';
import execall = require('execall2');
const execall = require('execall2');
let t = execall(/(?<k>.)/g, '123456789');
console.dir(t, {
colors: true,
});
console.log('getOwnPropertyNames', Object.getOwnPropertyNames(t));
let {re, input} = t;
console.log('== hidden property ==');
console.dir({re, input}, {
colors: true,
});
console.log('== hidden property symbol ==');
// @ts-ignore
console.dir([execall.SYMBOL, t[0][execall.SYMBOL] === t], {
colors: true,
});
console.log('== JSON.stringify ==');
console.log(JSON.stringify(t));
[ [ '1', '1', index: 0, groups: { k: '1' }, match: '1', sub: [ '1' ] ],
[ '2', '2', index: 1, groups: { k: '2' }, match: '2', sub: [ '2' ] ],
[ '3', '3', index: 2, groups: { k: '3' }, match: '3', sub: [ '3' ] ],
[ '4', '4', index: 3, groups: { k: '4' }, match: '4', sub: [ '4' ] ],
[ '5', '5', index: 4, groups: { k: '5' }, match: '5', sub: [ '5' ] ],
[ '6', '6', index: 5, groups: { k: '6' }, match: '6', sub: [ '6' ] ],
[ '7', '7', index: 6, groups: { k: '7' }, match: '7', sub: [ '7' ] ],
[ '8', '8', index: 7, groups: { k: '8' }, match: '8', sub: [ '8' ] ],
[ '9', '9', index: 8, groups: { k: '9' }, match: '9', sub: [ '9' ] ] ]
getOwnPropertyNames [ '0', '1', '2', '3', '4', '5', '6', '7', '8', 'length', 're', 'input' ]
== hidden property ==
{ re: /(?<k>.)/g, input: '123456789' }
== hidden property symbol ==
[ Symbol(execall), true ]
== JSON.stringify ==
[["1","1"],["2","2"],["3","3"],["4","4"],["5","5"],["6","6"],["7","7"],["8","8"],["9","9"]]
execall(/(\d+)/g, '$200 and $400');
/*
[ [ '200',
'200',
index: 1,
groups: undefined,
match: '200',
sub: [ '200' ] ],
[ '400',
'400',
index: 10,
groups: undefined,
match: '400',
sub: [ '400' ] ] ]
*/
Returns an array of objects with a match, sub-matches, and index.
declare function execAll<T extends RegExp = RegExp>(inputRegExp: T | RegExp, input: string, options?: IExecAllOptions<T>): IMatches<T>;
Type: regexp
Regular expression to match against the input.
Type: string
Type: IExecAllOptions
export interface IExecAllOptions<T extends RegExp = RegExp>
{
resetLastIndex?: boolean,
cloneRegexp?: ICloneRegexp<T>,
}
export interface ICloneRegexp<T extends RegExp = RegExp>
{
(inputRegExp: T | RegExp, ...argv): T
}
MIT © Sindre Sorhus
FAQs
Find multiple RegExp matches in a string
The npm package execall2 receives a total of 493 weekly downloads. As such, execall2 popularity was classified as not popular.
We found that execall2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.