Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Nov 19, 2024
1 parent 34957f4 commit 19564b0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,20 @@ if (matchString.find()) {
}
```

Example to collect all matches in string:

```js
import { RE2JS } from 're2js'

const p = RE2JS.compile('abc+')
const matchString = p.matcher('abc abcccc abcc')
const results = []
while (matchString.find()) {
results.push(matchString.group())
}
results // ['abc', 'abcccc', 'abcc']
```

#### Named Group Content

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

0 comments on commit 19564b0

Please sign in to comment.