Consider this snippet using regular expressions in Python 3:
>>> t = "Meu cão é #paraplégico$."
>>> re.sub("[^A-Za-z0-9 ]","",t,flags=re.UNICODE)
'Meu co paraplgico'
Why does it delete non-ASCII characters? I tried without the flag and it's all the same.
As a bonus, can anyone make this work on Python 2.7 as well?