2

I need to replace ^A, ^B in a file, the following command is useless :s/^A/

2 Answers 2

7

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.