Add delimiters to your regexes:
$pattern = "/^[a-z".$idn."0-9\-]{3,}$/";// same for "/^[a-z0-9\-]{3,}$/"
// here __^ and here __^
if(preg_match($pattern, strtolower($this->get_domain())) &&
!preg_match("/^-|-$/",strtolower($this->get_domain())) &&
// __^ __^
!preg_match("/--/", strtolower($this->get_domain()))){