5 ms·
You can add a literal operator: auto operator "" _r(char const* str, unsigned long) { return std::regex{str}; } To avoid all the backslashes, yo
by bstamour 7y ago
You can add a literal operator:
auto operator "" _r(char const* str, unsigned long) {
return std::regex{str};
}
To avoid all the backslashes, you can use a raw string literal:
int main() {
auto myre = R"(^hello\w*)"_r;
}