You could go for a simple expression like
^s+$
In Python
:
import re
lst = ['(02271) 6 79', ' 70', '
', '(02271) 6 79', '
', ' 70', '
', '
', '(02181) 27 0', '
', '3-0', '
', '
', '(02181) 27 0', '
', '3-0', '
', '
', '(02161) 24 19', '
', ' 40', '
', '
', '(02161) 24 19', '
', ' 40', '
', '
', '(02131) 66 67', '
', ' 10', '
', '
', '(02131) 66 67', '
', ' 10', '
', '
', '(02103) 39 00', '
', ' 93', '
', '
', '(02103) 39 00', '
', ' 93', '
', '
', '(02173) 2 04 7', '
', '3-0', '
', '
', '(02173) 2 04 7', '
', '3-0', '
', '
', '(02235) 9 23 04', '
', ' 30', '
', '
', '(02235) 9 23 04', '
', ' 30', '
', '
', '
', '(0221) 3 46 79 40', '
', '
', '
', '(0221) 3 46 79 40', '
', '
', '(02232) 4 23', '
', ' 05', '
', '
', '(02232) 4 23', '
', ' 05', '
', '
', '(0157) 86 85 74', '
', ' 43', '
', '
', '(0157) 86 85 74', '
', ' 43', '
', '
', '(02181) 2 78 11', '
', ' 47', '
', '
', '(02181) 2 78 11', '
', ' 47', '
', '
', '(02181) 47 49 0', '
', '0-0', '
', '
', '(02181) 47 49 0', '
', '0-0', '
', '
', '(02202) 1 88', '
', ' 60', '
', '
', '(02202) 1 88', '
', ' 60', '
', '
', '(0211) 23 80', '
', ' 70', '
', '
', '(0211) 23 80', '
', ' 70', '
', '
', '(02235) 9 23 0', '
', '4-0', '
', '
', '(02235) 9 23 0', '
', '4-0', '
']
rx = re.compile(r'^s+$')
lst = [item.strip() for item in lst if not rx.match(item)]
print(lst)
This yields and strips all numbers that are not only whitespaces from start to end:
['(02271) 6 79', '70', '(02271) 6 79', '70', '(02181) 27 0', '3-0', '(02181) 27 0', '3-0', '(02161) 24 19', '40', '(02161) 24 19', '40', '(02131) 66 67', '10', '(02131) 66 67', '10', '(02103) 39 00', '93', '(02103) 39 00', '93', '(02173) 2 04 7', '3-0', '(02173) 2 04 7', '3-0', '(02235) 9 23 04', '30', '(02235) 9 23 04', '30', '(0221) 3 46 79 40', '(0221) 3 46 79 40', '(02232) 4 23', '05', '(02232) 4 23', '05', '(0157) 86 85 74', '43', '(0157) 86 85 74', '43', '(02181) 2 78 11', '47', '(02181) 2 78 11', '47', '(02181) 47 49 0', '0-0', '(02181) 47 49 0', '0-0', '(02202) 1 88', '60', '(02202) 1 88', '60', '(0211) 23 80', '70', '(0211) 23 80', '70', '(02235) 9 23 0', '4-0', '(02235) 9 23 0', '4-0']
As @dawg points out, a regular expression is not really needed, actually:
lst = [number for item in lst for number in [item.strip()] if number]