title: Javascript regular expression to validate URL
body: <p>I am validating URL with following regular expression. I want to validate <strong>google.com</strong> also but it returns false. What can be changed in R.E below to validate <strong>google.com</strong>.</p>
  
  <pre><code>console.log(learnRegExp('http://www.google-com.123')); // false
  console.log(learnRegExp('https://www.google-com.com')); // true
  console.log(learnRegExp('http://google-com.com')); // true
  console.log(learnRegExp('http://google.com')); //true
  console.log(learnRegExp('google.com')); //false
  
  function learnRegExp(){
    return /^(ftp|https?):\/\/+(www\.)?[a-z0-9\-\.]{3,}\.[a-z]{3}$/.test(learnRegExp.arguments[0]);
  }
  </code></pre>