import re >>> r_bump = re.compile(r'((?:[A-Z][a-z]+){2,})') >>> input = 'BumpOne:BumpTwo:BumpThree' >>> pos = 0 >>> while 1: ... m = r_bump.match(input[pos:]) ... if m: ... print m.group(1) ... pos += m.end() ... if pos < len(input): ... assert input[pos:].startswith(':') ... pos += 1 ... else: break ... BumpOne BumpTwo BumpThree >>>