I am trying to parse some logs with non printable Unicode characters in the file:
02 Aug 2018 18:00:00,531 ^[[32m[TEXT]^[[m (ussouth-dc2-ms-2012) This.is.test.log: Service is responding normal
How can I avoid ^[[32m
and ^[[m
?
^([0-9]{2}\s[A-Za-z]{3}\s[0-9]{4}\s[0-9]{2}:[0-9]{2}:[0-9]{2}(?:,[0-9]{3})?)\s(?:\^\[\[[0-9]{2}m)\[([A-Za-z]+)\](?:\^\[\[m)\s(.*)
My current regex is treating them as normal characters which seems to work fine with I copy paste in online regex tested but when I use the system regex (possibly using java) it fails to parse which is because the file contains non-printable Unicode character.