import res = '''US/Canada/fowardslash @/t t/'''rx = r'(?<=[^\W\d_])/(?=[^\W\d_])|(/)'print(re.sub(rx, lambda m: '' if m.group(1) else ' ', s))
Standard input is empty
US Canada fowardslash @t t
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!