#include <iostream>
#include <regex>
int main()
{
std::string text = R"(11111111111111111111
11111111111111111111
11111111111111111111
11111111111110000000
11111111111000000000
11111111100011111100
11111111100111100000)";
std::regex re("^1+\n");
std::string str = std::regex_replace(text, re, "");
std::cout << str;
return 0;
}
Why does the exact same code when compiled under visual studio, trims all lines containing 11111111111111111111
?
I would like to it behave the same as on the link above, replacing just the first occurrence.
Do i need any kind of 'special' flag into the regex?