import re data = "(The rain - :in ,Spain?)"regexpat = re.sub(r"[',;.:/?()-]+", "", data) print(' '.join(regexpat.split()))
Standard input is empty
The rain in Spain
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!