Как обнаружить цвет ANSI в Linux с помощью std :: regex в c ++Linux

Anonymous
Как обнаружить цвет ANSI в Linux с помощью std :: regex в c ++

Сообщение Anonymous »

Как обнаружить цвет ANSI в Linux? < /p>

Код: Выделить всё

#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]

Вернуться в «Linux»