0

I cannot find a good example of the proper escape character sequence to replace all occurrences in vi of this string: "][" with "," (no quotes).

I'd prefer to do it via python or a shell script but vi is fine too as long as I can do a global replace manually.

jason
  • 11
  • 2
  • Possible duplicate of [How to escape square closing bracket in sed](https://stackoverflow.com/questions/27973519/how-to-escape-square-closing-bracket-in-sed) – tripleee Feb 24 '18 at 18:32

1 Answers1

0

This should work in vi:

:%s/\]\[/,/g

 ^  ^    ^ ^
 |  |    | |___replace all ocurrences
 |  |    |
 |  |    |_____replace with ,
 |  |
 |  |__________replace escaped \]\[
 |
 |_____________replace in whole file
DTown
  • 141
  • 5