compile-time-regular-expressions
compile-time-regular-expressions copied to clipboard
Proper way to get result position of search
trafficstars
Hello, given e.g.
auto res = ctre::search<"\\.[0-9]+$">("foo.123");
with std::regex one can get the "foo" part with the prefix() method of std::match_results. Is there a correct way to have the same functionality with ctre? One cannot just compare the iterator of to_view().begin() with the original string's iterator as it is UB to compare iterators of different objects and comparing the pointers to the underlying data() is error-prone
I think you can take a look at this. #157 The author said
ctre::range returns a range of matches which are equivalent of a cycling with repeated ctre::search calls