next-match
Math groups with next.
installation
npm install -S @jswork/next-match
usage
import '@jswork/next-match';
const str = '/api/v1/{id}/{uuid}/{a.b}';
nx.match(str, /{(.*?)}/g, 0); // [ '{id}', '{uuid}', '{a.b}' ]
nx.match(str, /{(.*?)}/g, 1); // ['id', 'uuid', 'a.b']
license
Code released under the MIT license.