import re
pattern = r"(\d)\1{2,}|(\d)\2"
strings = ["123456678", "12334566", "12345654554888", "1221", "66", "122", "221", "1234566678", "1222", "2221", "111"]
for s in strings:
match = re.search(pattern, s)
if match and match.group(2):
print ("Match: " + match.string)
else:
print ("No match: " + s)
aW1wb3J0IHJlCgpwYXR0ZXJuID0gciIoXGQpXDF7Mix9fChcZClcMiIKc3RyaW5ncyA9IFsiMTIzNDU2Njc4IiwgIjEyMzM0NTY2IiwgIjEyMzQ1NjU0NTU0ODg4IiwgIjEyMjEiLCAiNjYiLCAiMTIyIiwgIjIyMSIsICIxMjM0NTY2Njc4IiwgIjEyMjIiLCAiMjIyMSIsICIxMTEiXQoKZm9yIHMgaW4gc3RyaW5nczoKICAgIG1hdGNoID0gcmUuc2VhcmNoKHBhdHRlcm4sIHMpCiAgICBpZiBtYXRjaCBhbmQgbWF0Y2guZ3JvdXAoMik6CiAgICAgICAgcHJpbnQgKCJNYXRjaDogIiArIG1hdGNoLnN0cmluZykKICAgIGVsc2U6CiAgICAgICAgcHJpbnQgKCJObyBtYXRjaDogIiArIHMp