search-nth

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i search-nth

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ufukomer