import re

string = "Foo \n value of something \n Bar \n Another value \n"
changewords = ["foo", "Bar"]

tem = string
for i in changewords:
    tem = re.sub(f'(?i){i} \n', f'{i}:', tem)
print( tem )
