I tried replacing three words in this string by regular expression. But I only get the last replacements not the whole three.
import re
input_txt='The quick brown fox jumps over the lazy dog.'
dic={'The':'THE', 'fox':'FOX', 'dog':'DOG'}
for i,j in dic.items():
output2=re.sub(i,j,input_txt)
print(output2)
output2 value:
The quick brown fox jumps over the lazy DOG.