findall

finds all regex matchings

npm install findall
8 downloads in the last week
35 downloads in the last month

findall

finds all regex matchings

findall = require('findall')

text = 'lorem $ipsum sit $dolor amet'

findall(text, /($\w+)/)
['$ipsum', '$dolor']

See test.js for more info.

Install

$ npm install findall

Warning

Never pass a variable that points an expression:

var re = /this wont work!!/

findall('never do this', re)

Always pass the regex itself.

findall('this will work', /whatever regex is/)

npm loves you