def splitByExtension(src):
    ptrn = '#define\\s+[A-Z0-9_]+_EXTENSION_NAME\\s+"([^"]+)"'
    match = '#define\\s+('
    for part in re.finditer(ptrn, src):
        match += (part.group(1) + '|')
    match = (match[:(- 1)] + ')\\s+1')
    parts = re.split(match, src)
    byExtension = [(None, parts[0])]
    for ndx in range(1, len(parts), 2):
        byExtension.append((parts[ndx], parts[(ndx + 1)]))
    return byExtension
def splitByExtension(src):
    ptrn = '#define\\s+[A-Z0-9_]+_EXTENSION_NAME\\s+"([^"]+)"'
    match = '#define\\s+('
    for part in re.finditer(ptrn, src):
        match += (part.group(1) + '|')
    match = (match[:(- 1)] + ')\\s+1')
    parts = re.split(match, src)
    byExtension = [(None, parts[0])]
    for ndx in range(1, len(parts), 2):
        byExtension.append((parts[ndx], parts[(ndx + 1)]))
    return byExtension