I want to find all consecutive, repeated character blocks in a string. For example, consider the following:
s = r\'http://www.google.com/search=ooo-jjj\'
The following code should solve your problem:
s="abc def aaa bbb ccc def hhh" for match in re.finditer(r"(\w)\1\1", s): print s[match.start():match.end()]