Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danielberndt/match-all

return all regexp-match objects for a string
https://github.com/danielberndt/match-all

Last synced: about 19 hours ago
JSON representation

return all regexp-match objects for a string

Awesome Lists containing this project

README

        

# match-all

return all regexp-match objects for a string

## install

```
npm i @danielberndt/match-all;
```

## usage:

```javascript
import matchAll from "@danielberndt/match-all";

const matches = matchAll("f:1 o:2 o:3", /\w:(\d+)/);
console.log(matches.length); // -> 3
console.log(matches[0][1]); // -> '1'
```