Skip to content

Commit

Permalink
2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kaboc committed Dec 28, 2023
1 parent c05b76b commit 112f62a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.3.0

- Change `matchers` of TextParser from `List` to `Iterable`.
- Add `ExactMatcher`.

## 2.2.0

- Improve `parse()` to skip parsing if text is empty.
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,21 @@ Output:
[https://example.com/, Content inside tags]
```

### ExactMatcher

`ExactMatcher` escapes reserved characters of RegExp so that those are used
as ordinary characters. The parser extracts the substrings that exactly match
any of the strings in the passed list.

```dart
TextParser(
matchers: [
// 'e.g.' matches only 'e.g.', not 'edge' nor 'eggs'.
ExactMatcher(['e.g.', 'i.e.']),
],
)
```

### Groups

Each [TextElement][TextElement] in a parse result has the property of
Expand Down Expand Up @@ -241,6 +256,7 @@ These options are passed to [RegExp][RegExp] internally, so refer to its
[UrlLikeMatcher]: https://pub.dev/documentation/text_parser/latest/text_parser/UrlLikeMatcher-class.html
[EmailMatcher]: https://pub.dev/documentation/text_parser/latest/text_parser/EmailMatcher-class.html
[TelMatcher]: https://pub.dev/documentation/text_parser/latest/text_parser/TelMatcher-class.html
[ExactMatcher]: https://pub.dev/documentation/text_parser/latest/text_parser/ExactMatcher-class.html
[PatternMatcher]: https://pub.dev/documentation/text_parser/latest/text_parser/PatternMatcher-class.html
[parse]: https://pub.dev/documentation/text_parser/latest/text_parser/TextParser/parse.html
[TextElement]: https://pub.dev/documentation/text_parser/latest/text_parser/TextElement-class.html
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: text_parser
description: A Dart package for flexibly parsing text into easy-to-handle format according to multiple regular expression patterns.
version: 2.2.0
version: 2.3.0
repository: https://github.com/kaboc/dart_text_parser

topics:
Expand Down

0 comments on commit 112f62a

Please sign in to comment.