Remove ANSI escape sequences from lines before handing them to output parsers

If a build tool (e.g. gcc) outputs colored text, the ANSI escape
sequences will prevent the output parsers from matching the lines.  This
patch makes the ErrorParserManager remove them before handing the
strings to the parsers.

I tested that this works well with the ANSI console plugin [1], which
allows displaying colors in the console window.

Note that I stole the regex from this SO post [2], I hope it's trivial
enough that it doesn't cause any IP problem.

[1] https://marketplace.eclipse.org/content/ansi-escape-console
[2] https://stackoverflow.com/questions/25189651/how-to-remove-ansi-control-chars-vt100-from-a-java-string

Change-Id: I0d6a25723be4008600acecb8595865bcb4f4abc1
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
1 file changed