makere = lambda n: ''.join(['(.*?)(.+)(.*?)(.+)(.*?)'] + [
    '(.*)(\\2)(.*)(\\4)(.*)'] * (n - 1))
inp = ['asometxt0moretxt', 'bsometxt1moretxt', 'aasometxt10moretxt',
    'zzsometxt999moretxt']
re.match(makere(len(inp)), ''.join(inp)).groups()
Python string pattern recognition/compression