#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2010 Doug Hellmann. All rights reserved. # """Repetition of patterns """ #end_pymotw_header import re text = 'abbaaabbbbaaaaa' pattern = 'ab' for match in re.findall(pattern, text): print 'Found "%s"' % match