13 using svmatch = std::match_results<std::string_view::const_iterator>;
15 template<
class B
idirIt,
class UnaryFunction>
23 auto callback = [&](
const std::match_results<BidirIt>&
match) {
41 std::regex_iterator<BidirIt> begin(
first,
last,
re), end{};
49 template<
class UnaryFunction>
50 std::string regex_replace(std::string_view
s,
const std::regex&
re,
UnaryFunction&&
f)
52 return regex_replace(
s.cbegin(),
s.cend(),
re, std::forward<UnaryFunction>(
f));
55 template<
class B
idirIt,
class UnaryFunction>
59 std::regex_token_iterator<BidirIt> end;
64 template<
class UnaryFunction>
67 regex_split(
s.begin(),
s.end(),
re, std::forward<UnaryFunction>(
f));
70 inline std::vector<std::string> regex_split(std::string_view
s,
const std::regex&
re)
72 std::vector<std::string> result;
73 regex_split(
s.begin(),
s.end(),
re, [&result](
auto&&
m) { result.push_back(m.str()); });
constexpr auto bit_count
Equal to the number of bits in the type.
std::match_results< std::string_view::const_iterator > svmatch
Shamelessly stolen from https://stackoverflow.com/a/37516316.