title: How do I extract links from HTML using regex?
body: <p>I want to extract links from google.com; My HTML code looks like this:</p>
  
  <pre><code>&lt;a href="http://www.test.com/" class="l"
  </code></pre>
  
  <p>I took me around five minutes to find a regex that works using www.rubular.com.
  It is:</p>
  
  <pre><code>"(.*?)" class="l"
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>require "open-uri"
  url = "http://www.google.com/search?q=ruby"
  
  source = open(url).read()
  links = source.scan(/"(.*?)" class="l"/) 
  
  links.each { |link| puts #{link} 
  }
  </code></pre>
  
  <p>The problem is, is it not outputting the websites links. </p>