Hello, @ALISSAbry, @gurikbal-singh, @cipher-1024 and All,
Ahrrrrrhh ! You’re perfectly right, @cipher-1024 : my regex does not work, if no extra blank lines exist :-((
I first had found a correct regex. However, as I also wanted to delete possible pure blank lines, I tried to improve my regex against a text containing some blank lines
But I had not tested it again, with a simple text, without extra blank lines. My bad !
So a correct regex could be :
SEARCH (\R){2,}|(?<!=)\r\n(?!=)
REPLACE ?1\1:\x20
Notes :
Only, the second alternative have changed (?<!=)\r\n(?!=). It will replace any line-break, not preceded and not followed with an equal sign =. In other words, only the line breaks located between two data lines
Note that we must replace the \R syntax with the \r\n ( or with \n if you’re working with Unix files ! ) Why ? Just because \R represents \r\n, but in order to match an overall regex, \R may match only \r or \n
For instance, if you try to match the regex (?<!=)\R(?!=) at the end of the sentence …YEScrlf, it would grab only the \r part of the line break, before \n. Indeed, in that case, the \r character is, both, not preceded with an = sign ( as it is the letter S) and not followed with an = sign ( as it is the \n symbol )
Cheers,
guy038