Regex delete linebreak

0

I have a file in which I want to remove only certain line breaks, such as this example:

ProduceFalse:
Return a Boolean of value "false"

ProduceTrue:
Return a Boolean of value "true"

In the above example I would like to replace the line breaks after the : characters, so that the file looks like this:

ProduceFalse: Return a Boolean of value "false"

ProduceTrue: Return a Boolean of value "true"

To do that, I opened the file with Notepad++ and used the replace function with regular expressions. I can find occurences of these cases with the expression :[\r\n] perfectly, but replacing it with : seems to have no effect on the line break.

How can I remove a line break which I have found this way - or what would be a better way to do so (preferably in Notepad++ or with another editor's replace function, since I would love to use it under Windows)?

Dennis K.

Posted 2018-07-19T10:46:30.477

Reputation: 131

Answers

1

  • Ctrl+H
  • Find what: :\K\R
  • Replace with: 1 space
  • check Wrap around
  • check Regular expression
  • Replace all

Explanation:

:       : a semicolon
\K      : forget all we have seen until this position
\R      : any kind of linebreak

Toto

Posted 2018-07-19T10:46:30.477

Reputation: 7 722