I have a string variable in vimscript that contains some ANSI escape characters used for highlighting purposes. The string looks like,
^[[32m MyStringBody ^[[0m
I've put the escape code literally as vim displays it, it is the escape sequence - Ctrl-v-[.
I want to replace all occurences of such escape characters with a substitute command.
substitute(my_variable, pattern, '', 'g')
Can someone help me with a regex pattern that would remove these escape characters. Thanks.
^[[0mas literal text or as key sequence?