Skip to content

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