title: Regular expression to match only domain from URL
body: <p>I'm struggling with forming a regex that would match:</p>
  
  <ol>
  <li>Just domain in case of URL</li>
  <li>Whole string in case of no URL</li>
  </ol>
  
  <p>Acceptance test (regex should match bold text):</p>
  
  <ul>
  <li>http://<strong>mozart.co.uk</strong></li>
  <li>https://<strong>avocado.si/hmm</strong></li>
  <li><a href="http://www">http://www</a>.<strong>qwe123qwe.com</strong></li>
  <li><strong>Starbucks</strong></li>
  <li><strong>Benchmark 123</strong></li>
  </ul>
  
  <p>So far I've come up with this:</p>
  
  <pre><code>([^\/\/]+)(?:,|$)
  </code></pre>
  
  <p>It works fine, but not for URLs with trailing slash on the end. How can I modify the expression to include full path (everything on the right side of http(s)://) as well? Thank you.</p>