Convert from pair-based to list-based matching.