fork download
  1. import re
  2. text = "\n\n.AAA.x.@@+*@#=..xx000..x..\t.x..\nx*+Y."
  3. print(re.sub(r'([\W_])\1+',' ',text))
Success #stdin #stdout 0.02s 9600KB
stdin
Standard input is empty
stdout
 .AAA.x. +*@#= xx000 x 	.x 
x*+Y.