blob: 6a972593976a0c8803fb8ac54570296a83e70fef [file] [log] [blame]
Mathias Bynens79e2cf02020-05-29 14:46:171declare namespace execall {
2 interface Match {
3 match: string;
4 subMatches: string[];
5 index: number;
6 }
7}
8
9/**
10Find multiple RegExp matches in a string.
11
12@param regexp - Regular expression to match against the `string`.
13@returns The matches.
14
15@example
16```
17import execall = require('execall');
18
19execall(/(\d+)/g, '$200 and $400');
20// [
21// {
22// match: '200',
23// subMatches: ['200'],
24// index: 1
25// },
26// {
27// match: '400',
28// subMatches: ['400'],
29// index: 10
30// }
31// ]
32```
33*/
34declare function execall(regexp: RegExp, string: string): execall.Match[];
35
36export = execall;