Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Regex for white space and then line end

Tags:

regex

textpad

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

like image 252
Jack Kada Avatar asked Feb 15 '10 11:02

Jack Kada


2 Answers

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

^[[:space:]]*$
like image 141
soulmerge Avatar answered Sep 28 '22 12:09

soulmerge


^\s*$

If you've got perl-compatible regex.

like image 22
Andrew Aylett Avatar answered Sep 28 '22 13:09

Andrew Aylett