Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
9 lines (8 sloc) 223 Bytes
#include <ctre.hpp>
std::optional<std::string_view> match(std::string_view sv) {
if (auto match = regex<"^(name:[a-z]+):">(sv); match) {
return {true, match.get<"name">().first()};
} else {
return std::nullopt;
}
}