# string-matches

> Retrieves all the matches of a regex in a string.

Latest version **2.0.1** (published 2025-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install string-matches
pnpm add string-matches
yarn add string-matches
bun add string-matches
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-01-20 |
| First published | 2017-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | fabiospampinato |
| Keywords | string, matches |

## Links

- npm: https://www.npmjs.com/package/string-matches
- Repository: https://github.com/fabiospampinato/string-matches
- Homepage: https://github.com/fabiospampinato/string-matches#readme
- Issues: https://github.com/fabiospampinato/string-matches/issues
- npm.io page: https://npm.io/package/string-matches

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2025-01-20
- 2.0.0 — 2022-05-05
- 1.1.3 — 2018-12-06
- 1.1.2 — 2018-11-11
- 1.1.1 — 2018-11-05
- 1.1.0 — 2018-10-16
- 1.0.3 — 2018-10-16
- 1.0.2 — 2018-09-21
- 1.0.1 — 2017-03-25
- 1.0.0 — 2017-03-25

## README

# stringMatches

Retrieves all the matches of a regex in a string.

## Install

```shell
npm install string-matches
```

## Usage

```js
import stringMatches from 'string-matches';

// Let's get all the matches of a regex in a string

const str = 'A tidy tiger tied a tighter tie to tidy her tiny tail';
const regex = /tidy/g; // Don't forget the `g` flag, or it won't work

const matches = stringMatches ( str, regex );

console.log ( matches.length ); // => 2
```

## License

MIT © Fabio Spampinato

---
_Source: https://npm.io/package/string-matches · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
