-
Notifications
You must be signed in to change notification settings - Fork 450
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
Fixes #343
Merged
Merged
Fixes #343
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When doing literal extraction, a non-empty concatenation should always be cut when a `^` (for prefixes) or a `$` (for suffixes) is seen. If a counted repetition is used, e.g., `${2}`, then the cut detection fails. We add in a special case to handle it. Fixes rust-lang#321
When searching for captures, we first use the DFA to find the start and end of the match. We then pass just the matched region of text to the NFA engine to find sub-capture locations. This is a key optimization that prevents the NFA engine from searching a lot more text than what is necessary in some cases. One problem with this is that some instructions determine their match state based on whether the engine is at the boundary of the search text. For example, `$` matches if and only if the engine is at EOF. If we only provide the matched text region, then assertions like `\b` might not work, since it needs to examine at least one character past the end of the match. If we provide the matched text region plus one character, then `$` may match when it shouldn't. Therefore, we provide the matched text plus (at most) two characters. Fixes rust-lang#334
This shows how to use curly braces in the replacement string, and more specifically, explains why they are sometimes necessary. Fixes rust-lang#333
The example shows how to get the matched text of any capture group while defaulting to the empty string if that particular group didn't participate in the match. Fixes rust-lang#338
@bors r+ |
📌 Commit 9ae9418 has been approved by |
@bors retry |
☀️ Test successful - status-appveyor, status-travis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a series of commits that fixes several minor bugs.
Fixes #321, Fixes #334, Fixes #326, Fixes #333, Fixes #338