title: Regex for url without accept http | https | ftp and port with maximum value
body: <ol>
  <li>My url does not accept http | http | ftp.</li>
  <li>Url will accept www. part</li>
  <li>Url which accepts any number of sub domains.</li>
  <li>.com part as optional</li>
  <li>Url will accept the port number maximum value 0-65535.</li>
  </ol>
  
  <p>My regex is,</p>
  
  <pre><code>/^(?!(ftp|https?):\/\/)([a-zA-Z0-9]+\.)*[a-zA-Z0-9][a-zA-Z0-9-]+(\.[a-z]{2,6})?(:\d{1,5})?$/gm
  </code></pre>
  
  <p>This regex validation goes like this,</p>
  
  <ol>
  <li>www.example.com - true</li>
  <li><a href="http://example.com" rel="nofollow">http://example.com</a> - false</li>
  <li>www.example.etc.com - true</li>
  <li>www.example.com:62444 - true</li>
  <li><a href="https://example.com" rel="nofollow">https://example.com</a> - false</li>
  <li>localhost:64343 - true</li>
  </ol>
  
  <p>I am getting the error in my port part.</p>
  
  <p>It will accept any 5 digit number. I need to restrict this upto 0-65535.
  Because when the value exceeds 65535, It shows Uri format exception.</p>
  
  <p>Any suggestions please !</p>