I'm looking to match any string that contains a [DEBUG] statement and that eventually will have a ": " string following it. If there are several ": " strings following it, I want to match the first. The idea is to then color both the [DEBUG] statement and what's next to the first ": ".
An example would be:
[thread1] [DEBUG] [2017.03.12 23:22:12] com.abc.def.Xyz: some log message: some more specific info.
should be translated into:
[thread1] ${RED}[DEBUG]${DEFAULT} [2017.03.12 23:22:12] com.abc.def.Xyz: ${RED}some log message.${DEFAULT}
For that, I thought the following sed replace string would suffice, but it doesn't:
sed -r "s/(\[DEBUG\])([^:]*: )(.*)$/${RED}\1${DEFAULT}\2${RED}\3{$DEFAULT}/"
I've lost hours around this but unfortunately it doesn't match the shown above string. Any clues on why?