title: What regex can I use to get the domain name from a url in Ruby?
body: <p>I am trying to construct a regex to extract a domain given a url.</p>
  
  <p>for:</p>
  
  <pre><code>http://www.abc.google.com/
  http://abc.google.com/
  https://www.abc.google.com/
  http://abc.google.com/
  </code></pre>
  
  <p>should give:</p>
  
  <pre><code>abc.google.com
  </code></pre>