code: def validate_ports_string(ports):
          
          pattern = re.compile('^\\d+(-\\d+)?(,\\d+(-\\d+)?)*$')
          if pattern.match(ports) is None:
              return False
  
          ranges = PortsRangeHelper._get_string_port_ranges(ports)
          for r in ranges:
              if r.start > r.end or r.start > 65535 or r.end > 65535:
                  return False
          return True
docs: Validate that provided string has proper port numbers:
              1. port number < 65535
              2. range start < range end