@lzh1043060917 you have used the right method, although I don't know what the `'`s are for?
But adding the option to grep almost certainly won't help, the compiler widget is not a terminal, it is unlikely to interpret escape sequences. AFAIK "somebody" needs to add code to Geany to recognise the escape sequences and convert to Pango markup which should be recognised by the widget.