I use Python 2.6 and get [what I think] unexpected output from 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'
If this result is expected, what is its logic?
source
share