"[A-Z']+" and must use " instead of '
"[A-Z']+"
"
'
re.sub(r"[A-Z']+", lambda m: replacements[m.group()], t)