regex-occurrence
Get the number of occurrences of a RegExp in a string
Install
$ npm install --save regex-occurrence
Usage
const regexOccurrence = ; ;//=> 0 ;//=> 1 ;//=> 2 ;//=> 3
API
regexOccurrence(input, search)
input
Type: string
The string to search in.
search
Type: RegExp
, RegExp[]
The regular expressions to search for.
License
MIT © Sam Verschueren