string-matches
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

stringMatches

Retrieves all the matches of a regex in a string.

Install

$ npm install --save string-matches

Usage

import stringMatches from 'string-matches';

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

stringMatches ( str, regex ).length; // 2

Related

  • string-replace-all - Replaces all the occurrences of a string into a string with another string.

License

MIT © Fabio Spampinato

Readme

Keywords

Package Sidebar

Install

npm i string-matches

Weekly Downloads

22

Version

2.0.0

License

none

Unpacked Size

4.61 kB

Total Files

9

Last publish

Collaborators

  • fabiospampinato