1.0.0 • Published 7 years ago
search-nth v1.0.0
search-nth
Executes a search for nth match
The search-nth founds a pattern in a string, and then returns index of nth match. Similar to search() method.
Install
npm install --save search-nth
Usage
const search = require('search-nth');
const pattern = /\b\d+\b/;
const date = '21 2017 16:59:11';
search(date, pattern, 2)
//=> 3
License
MIT © Ömer Ufuk Efendioğlu
1.0.0
7 years ago