Replacing multiple blank lines with one blank line using RegEx search and replace

后端 未结 10 1806
旧巷少年郎
旧巷少年郎 2020-12-13 09:31

I have a file that I need to reformat and remove \"extra\" blank lines.

I am using the Perl syntax regular expression search and replace functionality of UltraEdit a

10条回答
  •  醉梦人生
    2020-12-13 09:55

    I'm not sure what UltraEdit lets you get away with in the "replace" area, but if you cannot use a newline (I've had this problem before) but can use capture references, this might work:

    Find    : \s*(\r\n)\s*(\r\n)\s*\r\n
    Replace : $1$2
    

    Not tested extensively, but seems to work on the sample you provided.

提交回复
热议问题