Convert matching string values to lists/dictionaries.

    :param dict parsed_data: The text of the command output that needs to be parsed.

    :return: A dictionary containing the modified configuration data.
    :rtype: dict

def _convert_parsed_show_output(parsed_data):
    '''
    Convert matching string values to lists/dictionaries.

    :param dict parsed_data: The text of the command output that needs to be parsed.

    :return: A dictionary containing the modified configuration data.
    :rtype: dict
    '''
    # Match lines like "main: xenial [snapshot]" or "test [local]".
    source_pattern = re.compile(r'(?:(?P<component>\S+):)?\s*(?P<name>\S+)\s+\[(?P<type>\S+)\]')
    sources = list()

    if 'architectures' in parsed_data:
        parsed_data['architectures'] = [item.strip() for item in parsed_data['architectures'].split()]
        parsed_data['architectures'] = sorted(parsed_data['architectures'])

    for source in parsed_data.get('sources', []):
        # Retain the key/value of only the matching named groups.
        matches = source_pattern.search(source)

        if matches:
            groups = matches.groupdict()
            sources.append({key: groups[key] for key in groups if groups[key]})
    if sources:
        parsed_data['sources'] = sources

    return parsed_data