# -*- coding: utf-8 -*- import re regex = re.compile(r"(?:(?:(♥)[\.]\1)|[^A])+[\-]+|(♥)\2", re.UNICODE) tweet = u"♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.♥..♥.♥.♥.♥.♥.♥.♥.♥.♥.♥.." print("ABOUT TO RUN REGEX") for match in regex.finditer(tweet): print(match) print("DONE RUNNING REGEX")