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

Fix anchor bug in Match iteration #470

Merged
merged 1 commit into from
Apr 28, 2018

Conversation

ethanpailes
Copy link
Contributor

The Match literal iterator would repeatedly look for matches
in the remainder of the input after it found its first
match regardless of whether or not the regex was anchored
at the start. This patch adds logic to make sure that we
don't keep looking for matches after the first match is
returned for a start-anchored literal regex.

This makes the failing tests pass and seems like the right thing to do
to me, but there could be a better place to fix the issue.

The Match literal iterator would repeatedly look for matches
in the remainder of the input after it found its first
match regardless of whether or not the regex was anchored
at the start. This patch adds logic to make sure that we
don't keep looking for matches after the first match is
returned for a start-anchored literal regex.
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@BurntSushi BurntSushi merged commit cf8acc7 into rust-lang:master Apr 28, 2018
@BurntSushi
Copy link
Member

Thank you!

@ethanpailes ethanpailes deleted the fix-anchored-literals branch April 28, 2018 14:36
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.

2 participants