def _parse_ctrl_d_all_show(output, regexp):
    """Function to parse lines like:

    array C

       physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SATA, 1 TB, OK)

    into an associative array with the matching result like:
    [('array C', [('1I:1:2', 'SATA', '1 TB', 'OK')]),]
    The regexp arg must extract the 4 informations from description lines.
    """
    arr = []
    cur = []
    idx = None
    for line in output.split('\n'):
        line = line.strip()
        if line[:5].lower() == 'array' or line.lower() == 'unassigned':
            if idx:
                arr.append((idx, cur))
                cur = []
            idx = line
        else:
            res = regexp.search(line)
            if res:
                cur.append(res.groups())

    if idx:
        arr.append((idx, cur))
    return arr