https://github.com/ecrmnn/regex-matches
Get regex matches without looping
https://github.com/ecrmnn/regex-matches
matchers regex regex-match
Last synced: 3 months ago
JSON representation
Get regex matches without looping
- Host: GitHub
- URL: https://github.com/ecrmnn/regex-matches
- Owner: ecrmnn
- License: mit
- Created: 2018-01-13T22:08:37.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-13T22:16:17.000Z (over 7 years ago)
- Last Synced: 2025-02-09T06:27:36.086Z (5 months ago)
- Topics: matchers, regex, regex-match
- Language: JavaScript
- Homepage: https://npmjs.com/regex-matches
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# regex-matches
> Get regex matches without looping[](https://travis-ci.org/ecrmnn/regex-matches/builds)
[](http://badge.fury.io/js/regex-matches)
[](http://badge.fury.io/js/regex-matches)
[](http://badge.fury.io/js/regex-matches)
[](http://makeapullrequest.com)
[](https://github.com/airbnb/javascript)### Installation
```bash
npm install regex-matches --save
```### Usage
```javascript
const re = require('regex-matches')re(/\b\w*[Oo]\w*\b/, 'the quick brown fox jumps over the lazy dog');
//=> [
//=> ['brown'],
//=> ['fox'],
//=> ['over'],
//=> ['dog']
//=> ]// Result when using capture groups
re(/\b\w*([Oo])\w*\b/, 'the quick brown fox jumps over the lazy dog');//=> [
//=> ['brown', 'o],
//=> ['fox', 'o],
//=> ['over', 'o],
//=> ['dog', 'o]
//=> ]
```### License
MIT © [Daniel Eckermann](http://danieleckermann.com)