tags:

views:

174

answers:

4

I am struggling to find this - I need to strip all empty lines which might have white space before them

The alternative is messing about in Excel - I am using TextPad

A: 
^\s*$

If you've got perl-compatible regex.

Andrew Aylett
A: 

A simple reg ex for any empty line which may contain white space is:

^[ \t]*$
Paul R
+1  A: 

According to this blog post on wordpress.com, it's

^[[:space:]]*$
soulmerge
A: 

Since you want to remove the line, this will not do:

^\s*$

You need to remove the line break after the empty line:

^\s*$[\n\r]*
Kobi