Suppose I have the following string:
s = 'Pingüino: Málaga es una ciudad fantástica y en Logroño me pica el... moño'
For what it was, I want to remove all the tildes and umlauts so that it looks like:
s = 'Pinguino: Malaga es una ciudad fantastica y en Logroño me pica el... moño'
# ^ ^ ^
I have discovered the library unidecode
that does exactly this:
>>> unidecode.unidecode(s)
'Pinguino: Malaga es una ciudad fantastica y en Logrono me pica el... mono'
But unfortunately it also replaces the ñ with n ( Logroño → Logrono , moño → mono ).
Is there any other library that allows this substitution, changing only the accents and umlauts? Otherwise, I understand that what I have to do is a regular expression that does this modification.