[ create a new paste ] login | about

Link: http://codepad.org/YRZBjjpB    [ raw code | output | fork ]

Python, pasted on Sep 14:
1
2
3
4
5
6
7
import re

original = [" ", "hello", '\t ', "", "world"]
print "original: " + str(original)

filtered = filter(lambda x:  not re.match(r'^\s*$', x), original)
print "filtered: " + str(filtered)


Output:
1
2
original: [' ', 'hello', '\t ', '', 'world']
filtered: ['hello', 'world']


Create a new paste based on this one


Comments: