title: need a regex to check whether URl entered is valid in typescript
body: <p>From research of the same,i came to find none of the suggested URL's matching my criteria, thus raised a new query.</p>
  
  <p>Following are my requirements :
  * The URL may or may not contain a 'http' or 'https'
  * The URL can be directly an IP address with a port number. </p>
  
  <p>Examples that should pass:</p>
  
  <ul>
  <li><a href="http://abcd.nju.in" rel="nofollow noreferrer">http://abcd.nju.in</a></li>
  <li>flower.insu-rge.ui</li>
  <li>192.89.32.4:8989</li>
  <li><a href="https://170.45.6.7" rel="nofollow noreferrer">https://170.45.6.7</a></li>
  <li>172.36.23.5</li>
  </ul>
  
  <p>Invalid Urls:</p>
  
  <ul>
  <li>http://</li>
  <li><a href="http://test" rel="nofollow noreferrer">http://test</a>.</li>
  <li>192.56.</li>
  <li>192.65</li>
  <li>test.xyz</li>
  </ul>