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

Non-ending split for adding anchors. #297

Open
Extra-Creativity opened this issue Oct 14, 2023 · 0 comments
Open

Non-ending split for adding anchors. #297

Extra-Creativity opened this issue Oct 14, 2023 · 0 comments

Comments

@Extra-Creativity
Copy link

I notice issue 296, and add anchors on regex. Though it's stupid because it definitely won't split anything, it may be expected to be an empty range instead of an infinite loop.

#include <iostream>
#include <ctre.hpp>

int main() {
    std::string data = "a\n\nb\n";
    auto lines = ctre::split<"^\n$">(data);
    for (auto line: lines) {
        auto t = line.to_string();
        std::cout << ">" << t << "<" << std::endl;
    }
}
@Extra-Creativity Extra-Creativity changed the title Non-ending split for anchor Non-ending split for adding anchors. Oct 14, 2023
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

No branches or pull requests

1 participant