I have quite large amount of text which include control charachters like \\n \\t and \\r. I need to replace them with a simple space--> \" \". What is the fastest way to do this
>>> re.sub(r'[\t\n\r]', ' ', '1\n2\r3\t4') '1 2 3 4'