regex_replace
Добавлено: 11 июн 2024, 17:39
https://ru.cppreference.com/w/cpp/regex/regex_replace
Вывод:
Код: Выделить всё
#include <iostream>
#include <regex>
#include <string>
int main()
{
std::string text = "Quick brown fox";
std::regex vowel_re("a|o|e|u|i");
std::cout << std::regex_replace(text, vowel_re, "[$&]") << '\n';
}
Код: Выделить всё
Q[u][i]ck br[o]wn f[o]x