def parse_version(cls, version_str):
        """Create a :class:`ProtocolFlags` object from a version string.

        Parameters
        ----------
        version_str : str
            The version string from a #version-connect katcp-protocol
            message.

        """
        match = cls.VERSION_RE.match(version_str)
        if match:
            major = int(match.group('major'))
            minor = int(match.group('minor'))
            flags = set(match.group('flags') or '')
        else:
            major, minor, flags = None, None, set()
        return cls(major, minor, flags)