I)は(Pythonの2.6を使用していますし、re.subから[私はと思われるもの]予期しない出力を取得しています誰かがこの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'
この出力が期待されているものである場合には、その背後にあるロジックは何ですか?
はいああ。パラメータの混合。ありがとうございました。 – kjfletch