I am trying to clean all color control characters from log file. I am able to clean all other control characters except ^[(B
. Please help me to clean this control character also.
I am using these combination to clean control characters.
cat $LOGFILE | sed -e 's/\x1b\[[0-9;]*m//g' > $LOGDIR/Temp.txt
ansi-regex
is spectacularly wrong. It has the date for ECMA-48:1976 wrong by two decades. This made me look hard at the regular expression itself. The doco is spectacularly wrong there, too. Far from covering more than all ECMA-48 control sequences, as it claims, it covers less. There is quite a range of what ECMA-48 §5.4 defines that it won't correctly match. Interestingly, the Stack Overflow answer is pointing out much the same thing about another regular expression with poor coverage. – JdeBP Jun 05 '16 at 09:29