Add method for returning either of the sets of port identifiers connected by a pattern.