import re
text = "An example striiiiing with other words"
rx = re.compile(r'i{3,}', re.I)
out_put = rx.sub(lambda x: r'*'*len(x.group()), text)
print(out_put)
# An example str***iing with other words
aW1wb3J0IHJlCnRleHQgPSAiQW4gZXhhbXBsZSBzdHJpaWlpaW5nIHdpdGggb3RoZXIgd29yZHMiCnJ4ID0gcmUuY29tcGlsZShyJ2l7Myx9JywgcmUuSSkKb3V0X3B1dCA9IHJ4LnN1YihsYW1iZGEgeDogcicqJypsZW4oeC5ncm91cCgpKSwgdGV4dCkKcHJpbnQob3V0X3B1dCkKIyBBbiBleGFtcGxlIHN0cioqKmlpbmcgd2l0aCBvdGhlciB3b3Jkcw==