<story><title>In search of the perfect URL validation regex (2010)</title><url>https://mathiasbynens.be/demo/url-regex</url></story><parent_chain></parent_chain><comment><author>likium</author><text>Even if you built a URL validation regex that follows rfc3986[1] and rfc3987[2], you will still get user bug reports because web browsers follow a different standard.&lt;p&gt;For example, &amp;lt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;example.com.&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;example.com.&amp;#x2F;&lt;/a&gt;&amp;gt; , &amp;lt;&lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;&amp;#x2F;example.com&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;&amp;#x2F;example.com&amp;#x2F;&lt;/a&gt;&amp;gt; and &amp;lt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Space (punctuation)&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Space (punctuation)&lt;/a&gt;&amp;gt; are classified as invalid urls in the blog, but they are accepted in the browser.&lt;p&gt;As the creator of cURL puts it, there is no URL standard[3].&lt;p&gt;[1]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.ietf.org&amp;#x2F;rfc&amp;#x2F;rfc3986.txt&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.ietf.org&amp;#x2F;rfc&amp;#x2F;rfc3986.txt&lt;/a&gt;&lt;p&gt;[2]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.ietf.org&amp;#x2F;rfc&amp;#x2F;rfc3987.txt&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.ietf.org&amp;#x2F;rfc&amp;#x2F;rfc3987.txt&lt;/a&gt;&lt;p&gt;[3]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;daniel.haxx.se&amp;#x2F;blog&amp;#x2F;2016&amp;#x2F;05&amp;#x2F;11&amp;#x2F;my-url-isnt-your-url&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;daniel.haxx.se&amp;#x2F;blog&amp;#x2F;2016&amp;#x2F;05&amp;#x2F;11&amp;#x2F;my-url-isnt-your-url&amp;#x2F;&lt;/a&gt;</text></comment>
<story><title>In search of the perfect URL validation regex (2010)</title><url>https://mathiasbynens.be/demo/url-regex</url></story><parent_chain></parent_chain><comment><author>dang</author><text>Two past discussions, for the curious:&lt;p&gt;&lt;i&gt;In search of the perfect URL validation regex&lt;/i&gt; - &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;news.ycombinator.com&amp;#x2F;item?id=10019795&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;news.ycombinator.com&amp;#x2F;item?id=10019795&lt;/a&gt; - Aug 2015 (77 comments)&lt;p&gt;&lt;i&gt;In search of the perfect URL validation regex&lt;/i&gt; - &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;news.ycombinator.com&amp;#x2F;item?id=7928968&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;news.ycombinator.com&amp;#x2F;item?id=7928968&lt;/a&gt; - June 2014 (81 comments)</text></comment>