regex to remove lines made of only whitespace

Chris Withers chris at simplistix.co.uk
Wed Aug 11 07:13:29 EDT 2010


Hi All,

I'm looking for a regex (or other solution, as long as it's quick!) that 
could be used to strip out lines made up entirely of whitespace.

eg:

'x\n \t \n\ny' -> 'x\ny'

Does anyone have one handy?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk



More information about the Python-list mailing list