Search code examples
regexnotepad++

How do I eliminate line breaks and carriage returns in notepad++


I have the following address in Notepad++ and I want to change it to single line:

2400 Highway 31 SW

FooBar

AL

37770

Using find/replace so that the result looks like this:

2400 Highway 31 SW FooBar AL 37770


Solution

  • You should be able to do this with a repeated combination of "CR? + LF":

    1. Press: Ctrl + H (Replace)
      1. Find what: (\r?\n)\1
      2. Replace with:
      3. Search mode: Regular expression