Case-insensitive replace
import re
print(re.sub('(?i)the', 'CALEB', 'The quick brown fox jumped over the lazy dog. Then he went home.'))INFO
import re
print(re.sub('(?i)the', 'CALEB', 'The quick brown fox jumped over the lazy dog. Then he went home.'))