A simple task: to replace the date in the format "dd.mm.yyyy" by "dd month yyyy" On Perl I did it quickly, but on C ++.
std::string date = "12.10.2017"; std::regex monthSE(R"((?=\.)\d\d(?=\.))"); std::vector<std::string> months = { "", "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"}; std::smatch matched; std::regex_search(date, matched, monthSE); if (!matched.size()) { break; } std::string asd = matched[0].str(); int month = atoi(matched[0].str().c_str()); std::regex monthRE(R"(\.\d\d\.)"); date = std::regex_replace(date, monthRE, " " + months[month] + " ");