Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Non-exhaustive Matching Mode #80

Merged
merged 5 commits into from
Jun 24, 2020

Conversation

fbartho
Copy link
Contributor

@fbartho fbartho commented Jun 18, 2020

Fixes #72

Since the way we parse text in this library basically implies the global flag is always enabled, we've had a request for non-global mode.

The way to enable it is by passing nonExhaustiveModeMaxMatchCount: 1 as an extra prop for your parse pattern configuration.

If you want, you can change the number higher to accept a certain number of matches, and then stop.
For Example: if you were going to give URL previews, but only to the first 2 URLs in a given chunk of Text, you would pass nonExhaustiveModeMaxMatchCount: 2

TODO

Out-of-scope

  • Rework things to pass a test of nested matchers [b]Bold[/b][i]italic[b]italic and bold[/b][/i] (This may be a bug in the fundamental architecture) -- discuss in Feature: Nested Matchers #81

@fbartho fbartho merged commit 933f70f into release/0.0.22 Jun 24, 2020
@fbartho fbartho added this to the 0.0.22 milestone Jun 24, 2020
@fbartho
Copy link
Contributor Author

fbartho commented Jun 24, 2020

@fbartho fbartho deleted the feat/non-exhaustive-matching-mode branch June 24, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant