original_string: protected function isValidDomain($hostname)
      {
          return preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $hostname)
              && preg_match("/^.{1,253}$/", $hostname)
              && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $hostname)
              && !preg_match("/^\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}$/", $hostname);
      }
code: protected function isValidDomain($hostname)
      {
          return preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $hostname)
              && preg_match("/^.{1,253}$/", $hostname)
              && preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $hostname)
              && !preg_match("/^\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}$/", $hostname);
      }
code_tokens: protected function isValidDomain ( $ hostname ) { return preg_match ( "/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i" , $ hostname ) && preg_match ( "/^.{1,253}$/" , $ hostname ) && preg_match ( "/^[^\.]{1,63}(\.[^\.]{1,63})*$/" , $ hostname ) && ! preg_match ( "/^\d{0,3}\.\d{0,3}\.\d{0,3}\.\d{0,3}$/" , $ hostname ) ; }
docstring: Check if the hostname is valid a valid domain name according to RFC 3986 and RFC 1123
  
  @param string $hostname
  @return boolean
docstring_tokens: Check if the hostname is valid a valid domain name according to RFC 3986 and RFC 1123