J'utilise Python 2.6 et reçois [ce que je pense est] sortie inattendue de re.sub()Quelqu'un peut-il expliquer cette sortie inattendue de Python re.sub()?
>>> re.sub('[aeiou]', '-', 'the cat sat on the mat')
'th- c-t s-t -n th- m-t'
>>> re.sub('[aeiou]', '-', 'the cat sat on the mat', re.IGNORECASE)
'th- c-t sat on the mat'
Si cette sortie est ce qui est attendu, quelle est la logique derrière tout cela?
Ah oui. Mélanger les paramètres. Je vous remercie. – kjfletch