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;
}
}
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.