fork download
  1. # -*- coding: utf-8 -*-
  2. import re
  3. s = u"characters (in this case, they are áéíóöőúüű)."
  4. res = re.sub(ur'\W+', u' ', s, flags=re.UNICODE).encode("utf8")
  5. print(res)
  6.  
Success #stdin #stdout 0s 23352KB
stdin
Standard input is empty
stdout
characters in this case they are áéíóöőúüű