@staticmethod
    def string2port(info):
        """
        Extract port number, protocol and description from an string.

        ..note:
            Raises value error if information can't be processed.

        >>> p=Port.string2port("callbook (2000/tcp)")
        >>> print p.number
        2000
        >>> print p.description
        "callbook"
        >>> print p.protocol
        "tcp"
        
        :param info: raw string with port information 
        :type info: basestring

        :return: Port instance
        :rtype: Port

        :raises: ValueError
        """
        if not isinstance(info, str):
            raise TypeError(type(info) % "Expected basestring, got '%s' instead")
        
        regex = re.search("([\w\W]+)(\()([\d]+)(/)([\w]+)", info)

        if regex:
            if len(regex.groups()) != 5:
                raise ValueError("Can't parse input string")

            description = regex.group(1).strip()
            number = int(regex.group(3))
            protocol = regex.group(5)

            return Port(number, protocol, description)

        else:
            raise ValueError("Can't parse input string")

    # ----------------------------------------------------------------------
dataset/ETHPy150Open cr0hn/openvas_to_report/openvas_to_report/libs/data/parsed_data.py/Port.string2port/swapped operands of `%`