When a hyphenated word is separated by a line break, I want to merge them. So the condition is that a hyphen is followed by a line break. If a hyphen is followed by a whitespace, nothing at all should happen.
This is to be merged because a line break follows:
This is a ice-
cream and this is a car
And in such examples, nothing at all should be merged because the line is clean.
This is a ice-cream and this is a car
How can I do this with regular expressions (I use Notepad++)?
If I use the following regular expression, then everything is just merged.
- Search for:
[^\s-]\K-\s+(?=[^\s-]) () - Replace with: nothing

(?<=-)\nand replace with nothing (demo).This is called a positive lookbehind.