title: Regex for domains with protocols Python
body: <p>I have written Python script which loops through txt file and it is trying to find domain in every line.</p>
  <p>requirements for regex:</p>
  <ul>
  <li>contain protocols such as http, https, www, etc.</li>
  <li>contain &quot;-&quot; for example, ab-cd.com</li>
  <li>contain numbers, letters, other characters, case insensitive</li>
  <li>contain URL for example, ab.com/home</li>
  </ul>
  <p>Regex for this is -&gt; <code>r&quot;(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]&quot;</code>
  But I want also find domains with protocols (http, https, www, etc.)</p>
  <p>I tried something like this -&gt; <code>r&quot;https://www\.|http://www\.|https://www|http://|https://|www\.|http.&quot;</code></p>
  <p>The point is, I am not able to merge those two.
  I am new to regex so if above lines of existing regex is wrong or could be better, I will be glad for your answer.</p>