Regular expression: easier "find empty lines"

Started by Stefan, January 20, 2009, 03:06:10 PM

Previous topic - Next topic

Stefan

The RegEx ^$ find empty lines.

But to replace them by nothing (to delete empty lines)
you have to search for line enders too: ^$\r\n

Other editor delete empty lines just simply by
Find: ^$
Replace:

I guess they add those EOL char at there own, without user access???
Maybe you want to do the same. Just if you once rewrite your regex engine, please think about this behavior.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Hello Stefan,

I think reason for such "non-standard" behavior, is same as problems with greedy search - I am trying to emulate text stream from array of single lines.

So probably when I would fix problem with greedy search, this would also gone. But I would check any way, and if it is easy would implment it with current logic (if this would no require big changes).

Thanks for suggestion ;)
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

alex

Hi once more,

which other editors you mean? I have tested several (EditPlus, Notepad++) but none of them works as you have described, but does it like hippoedit (mostly).

So now I am not sure, that this is a good solution... Because it is not standard and can be a surprise for user :)
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

  :o  right now all editors i test didn't support this.  ::)
Perhaps this was an dream only, because it is logically ?

Only VIMs :g/^$/ d and SEDs "/^$/d" (and perhaps PERL) do that.

So i was wrong, sorry.
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-