fork download
  1. import re
  2. my_text = "!where??and!!or$$then:)"
  3. print(re.sub(r'[]!"$%&\'()*+,./:;=#@?[\\^_`{|}~-]+', r' \g<0> ', my_text).strip())
  4.  
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
! where ?? and !! or $$ then :)