Flo’s Great Remove All Empty Lines Regex

If a file has a return on the last line of text followed by the file end assertion, it will not remove that extra return if you are searching for empty lines. This regex does the trick:

^!Replace “\R(?=\R)|\A\R|\R\z” >> “” AWRS

Note per Sheri: \z is an assertion for the position of end of the file. It has a width of zero characters. Ditto for \A, \Z, \z, ^ and $.

Leave a Reply

Recent Posts

Archives

Topics