Reputation: 742
I need to replace ^A, ^B in a file, the following command is useless :s/^A/
Upvotes: 2
Views: 343
Reputation: 827178
To get the ^A
character, press CTRL-V CTRL-A
If you have configured the "paste" action with CTRL-V (generally on Windows) you can use CTRL-Q instead of it.
Upvotes: 7
Reputation: 127447
You need to escape the ^ with a \, i.e. s/\^A/^B/
. ^ denotes "start of line" in a regular expression. In the replacement text, escaping is not necessary, but possible.
Upvotes: 3