better-match
v1.0.3
Published
Use regular expressions to search strings!
Downloads
35
Maintainers
Readme
better-match
- No need to remember to add
g
every time - returns an array of captures, making it usable in a functional manner
npm i better-match
betterMatch(
/(\d):(\d)/,
'1:4 5:6 2:3'
) // => [ [1, 4], [5, 6], [2, 3] ]
betterMatch(
/(?:^|\s)([^\s]{2})/g,
'lol butts'
) // => [ ['lo'], ['bu'] ]