title: Check if url is valid or not
body: <p>I tried to check if url is valid or invalid. the checks of 7,8 returns wrong outputs.</p>
  
  <pre><code>alert('1: ' + learnRegExp('http://www.google-com.123.com')); // true
  alert('2: ' + learnRegExp('http://www.google-com.123')); // false
  alert('3: ' + learnRegExp('https://www.google-com.com')); // true
  alert('4: ' + learnRegExp('http://google-com.com')); // true
  alert('5: ' + learnRegExp('http://google.com')); //true
  alert('6: ' + learnRegExp('google.com')); //true
  alert('7: ' + learnRegExp('ww.google.com')); //false -&gt; it returns true
  alert('8: ' + learnRegExp('www.google.co.il')); //true -&gt; it returns false
  alert('9: ' + learnRegExp('http://ww.google.co.il')); //false
  alert('10: ' + learnRegExp('https://ww.google.co.il')); //false
  
  function learnRegExp(){
      return /((ftp|https?):\/\/)?(www\.)?[a-z0-9\-\.]{3,}\.[a-z]{3}$/
      .test(learnRegExp.arguments[0]);
  }
  </code></pre>
  
  <p>please help me to solve it.</p>
  
  <p>any help appreciated!</p>