title: URL extraction from string
body: <p>I found a regular expression that is suppose to capture URLs but it doesn't capture some URLs. </p>
  
  <pre><code>$("#links").change(function() {
  
      //var matches = new array();
      var linksStr = $("#links").val();
      var pattern = new RegExp("^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$","g");
      var matches = linksStr.match(pattern);
  
      for(var i = 0; i &lt; matches.length; i++) {
        alert(matches[i]);
      }
  
  })
  </code></pre>
  
  <p>It doesn't capture this url (I need it to):</p>
  
  <blockquote>
    <p><a href="http://www.wupload.com/file/63075291/LlMlTL355-EN6-SU8S.rar" rel="nofollow">http://www.wupload.com/file/63075291/LlMlTL355-EN6-SU8S.rar</a></p>
  </blockquote>
  
  <p>But it captures this</p>
  
  <blockquote>
    <p><a href="http://www.wupload.com" rel="nofollow">http://www.wupload.com</a></p>
  </blockquote>