I pick text from bash and represent it in a QPlainTextEdit
. The problem is that the code contains ascii colors ([01;31m) and these are printed in QT like characters, which is very ugly. How can I eliminate this colors or represent in the right way.
Sorry for my bad English.
Output example in QPlainTextEdit
:
[0m[01m[K/home/aron/main.cpp:[m[K In function â[01m[Kint main()[m[Kâ:
SOLUTION:
std::string result = boost::regex_replace(text, boost::regex(R"(\x1B[([\d;])*(m|K))"), "");