Skip to content

Commit 19564b0

Browse files
committed
readme
1 parent 34957f4 commit 19564b0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,20 @@ if (matchString.find()) {
231231
}
232232
```
233233

234+
Example to collect all matches in string:
235+
236+
```js
237+
import { RE2JS } from 're2js'
238+
239+
const p = RE2JS.compile('abc+')
240+
const matchString = p.matcher('abc abcccc abcc')
241+
const results = []
242+
while (matchString.find()) {
243+
results.push(matchString.group())
244+
}
245+
results // ['abc', 'abcccc', 'abcc']
246+
```
247+
234248
#### Named Group Content
235249

236250
The `group()` method retrieves the content matched by a specific name of capturing group

0 commit comments

Comments
 (0)