Have text file with contents like:
^[[31morigin/some-branch^[[m
^[[31morigin/some-other-branch^[[m
These ^[ sequences are highlighted and treated as one character as they are ascii escape sequence. How do I use regex/replace on them?
For example I can do :%s/origin/potato/g to replace all origin with potato, but how do I replace the escaped sequence?
I tried :%s/<1b>\[[0-9;]*m//g but it gave E486: Pattern not found: <1b>\[[0-9;]*m
:h i_CTRL-V. For instance, you can demonstrate by typing/^V^[where that means these three keys: slash, Ctrl-V, Escape. Then hit Enter and you'll now hop from one instance of embedded Escape characters in your text to the next. – B Layer Jun 10 '21 at 20:52