Can someone explain what this following regex means : <p><code>/(.*?)((http:\/\/|https:\/\/)?[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,6}(\/[a-zA-Z0-9\-\.]+)*){1}(.*?)/g</code></p>

<p>I could only make some assumptions about the above regex. But most of it is cryptic to me.</p>

<p><code>(http:\/\/|https:\/\/)</code> - It contains either <code>http</code> or <code>https</code> protocol.</p>

<p><code>[a-zA-Z]{2,6}</code> - Contain any of the lower or uppercase characters between 2 and 6 times.</p>

<p><code>/g</code> - Search for it recursively</p>

<p>But was not able to put all of the blocks together.</p>
