Search code examples
regexnotepad++carriage-returnlinefeedcontrol-characters

Regex for matching linefeed with next character ignored


I am trying to select linefeed and remove them in a comma separated file via REGEX search in notepad++, the criteria for matching linefeed is that it should not followed the character "I" in the next line.

Example:- enter image description here

Output should be:- enter image description here


Solution

  • Tip: don't use images as we can't copy past them

    replace

    \r\n(?!|)
    

    with nothing

    Note that I assume your are using windows linebreaks \r\n