Код: Выделить всё
#include
#include
int main(){
std::string str = "\033[34m Hello \033[30m World";
std::smatch match;
std::regex blue_pattern(R"(\033\[34m)");
if(std::regex_search(str,match,blue_pattern)){
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79513108/how-detect-ansi-color-in-linux-with-stdregex-in-c[/url]
Мобильная версия