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 issue 10772 std.regex.splitter generates spurious empty elements #1790

Closed
wants to merge 1 commit into from

Conversation

DmitryOlshansky
Copy link
Member

//bugzilla 10772
auto s3 = "test";
assert(splitter(s3, regex("")).equal(["t", "e", "s", "t"]));
assert(splitter(s3, regex("x?")).equal(["t", "e", "s", "t"]));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this still create an empty token if there are two consecutive (non-empty) matches?
assert(splitter("texxt", regex("x?")).equal(["t", "e", "", "t"]));

Copy link
Collaborator

Choose a reason for hiding this comment

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

What about "xtestx"? "xxtestxx"?

Copy link
Member Author

Choose a reason for hiding this comment

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

This pull does something strange ;). Perl does something curious.
If you know what rules it follows exactly it would be nice. I can't wrap my head around them.

@DmitryOlshansky
Copy link
Member Author

Closing this due to controversy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants