title: what is pattern for preg_match_all to get domain name?
body: <p>I want get domain name from text, I can do easily for email but can't get for domain name. I used this code to get email address :</p>
  
  <pre><code>if (!empty($text)) {
    $res = preg_match_all(
      "/[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}/i",
      $text,
      $matches
    );
  }
  </code></pre>
  
  <p>What is the pattern for get only domain name from text?</p>