Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I replace the string "\r\n" with the same characters?


Hello World.\r\nHello World.

replaced with:

Hello World.
Hello World.
share|improve this question
up vote 59 down vote accepted

Press CTRL-h and the Replace dialog will open. Type \\r\\n in "Find what" and \r\n in "Replace with". Finally, select search mode Extended (\r, \n, \t, \x..., \0) and click "Replace All".

share|improve this answer
works in Programmer's notepad as well. Select "Allow backslash expressions" and do the same – Peter Munnings Jul 3 '12 at 19:05
Does that work in newer versions of Notepad++? Or does it require selecting the option "Extended (\n, \r, \t, \0, \x)"? – Peter Mortensen Feb 15 '14 at 19:14
Search mode has to be "Extended" to work. – Marcel Mar 19 '14 at 16:06
This also works in notepad2 in case anyone is interested. Check regular expression search when replacing – Hoppe Mar 31 '14 at 16:39
You could also do what I did and turn off extended search then replace \r\n with some unique string like "~~~~" then turn extended search back on and replace that string with \r\n. An extra step but it works. – Steve Hiner Oct 4 '14 at 0:11

In the find screen, on the replace tab choose extended search.
In the find text box put \\r\\n, and in the replace text box put \r\n.

share|improve this answer
Does this actually work, or do you need to do escaping? – Josh Hunt Sep 17 '09 at 14:21
I had escaping, but I had to double escape it for it to show up right here (ie \\\\r\\\\n instead of \\r\\n). – C. Ross Sep 17 '09 at 14:55
So did you just now have to quadruple escape that in the comment? ^^^^^^^ – hyperslug Sep 17 '09 at 15:31
No thankfully it doesn't try to interpret comments ... – C. Ross Sep 18 '09 at 14:55

Copy a newline and use the Search and Replace function to replace \r\n with the newline. The newline character will show up as an empty box.

share|improve this answer
I couldn't get this to work earlier. – C. Ross Sep 17 '09 at 14:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .