We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was wondering if there's a facility such as https://en.cppreference.com/w/cpp/regex/regex_replace in CTRE?
So far I was only able to come up with something not great
static constexpr auto pattern = ctll::fixed_string{" "}; std::string str = get_string(); std::string result; bool first = true; for (auto match : ctre::split<pattern>(str)) { if (!first) { result += "_"; } else { first = false; } result += std::string{match.get<0>()}; } fmt::print("{}\n", result);
https://godbolt.org/z/9PMzef97v
A better version but that would require C++26 (join_with is C++23, and ranges::to is C++26): https://godbolt.org/z/9vcTWePGe
The text was updated successfully, but these errors were encountered:
See #250
Sorry, something went wrong.
No branches or pull requests
I was wondering if there's a facility such as https://en.cppreference.com/w/cpp/regex/regex_replace in CTRE?
So far I was only able to come up with something not great
https://godbolt.org/z/9PMzef97v
A better version but that would require C++26 (join_with is C++23, and ranges::to is C++26): https://godbolt.org/z/9vcTWePGe
The text was updated successfully, but these errors were encountered: