Q:

Python Converting string into a list ignoring the special characters

I am having a string as :- 
'Current Weather\n\t\n\n\t\t12:36 AM\n\t\n\n\n\n\t\t\t22°\n\t\t\n\n\t\t\t\tC\n\t\t\t\n\n\n\t\tRealFeel®\n\t\t20°\n\t\n\n\t\tMostly clear'

I want to convert it into a list as :-
['Current Weather','12:36 AM','22°','C','RealFeel®','20°','Mostly clear']

Is there any python module or function with which I can do so?

A:

You can use re.split:
import re

s = 'Current Weather\n\t\n.....t\tMostly clear'
re.split(r'[\n\t]+', s)

Output:
['Current Weather', '12:36 AM', '22°', 'C', 'RealFeel®', '20°', 'Mostly clear']

