title: Validating a URL in Node.js
body: <p>I want to validate a URL of the types:</p>
  
  <ul>
  <li><code>www.google.com</code></li>
  <li><code>http://www.google.com</code></li>
  <li><code>google.com</code> </li>
  </ul>
  
  <p>using a single regular expression, is it achievable? If so, kindly share a solution in JavaScript.</p>
  
  <p>Please note I only expect the underlying protocols to be HTTP or HTTPS. Moreover, the main question on hand is how can we map all these three patterns using one single regex expression in JavaScript? It doesn't have to check whether the page is active or not. If the value entered by the user matches any of the above listed three cases, it should return <code>true</code> on the other hand if it doesn't it should return <code>false</code>.</p>