title: Python regex: Difference between (.+) and (.+?)
body: <p>I am new to regex and Python's urllib. I went through an online tutorial on web scraping and it had the following code. After studying up on regular expressions, it seemed to me that I could use (.+) instead of the (.+?) in my regex, but whoa was I wrong. I ended up printing way more html code than I wanted. I thought I was getting the hang of regex, but now I am confused. Please explain to me the difference between these two expressions and why it is grabbing so much html. Thanks!</p>
  <p>ps. this is a starbucks stock quote scraper.</p>
  <pre><code>import urllib
  import re
  
  url = urllib.urlopen(&quot;http://finance.yahoo.com/q?s=SBUX&quot;)
  htmltext = url.read()
  regex = re.compile('&lt;span id=&quot;yfs_l84_sbux&quot;&gt;(.+?)&lt;/span&gt;')
  found = re.findall(regex, htmltext)
  </code></pre>
  <p>print found</p>