title: Python regex: Multiple matches in one line (using findall())
body: <p>I'm looking for these "tags" inside text: <code>{t d="var1"}var2{/t}</code> or <code>{t d="varA"}varB{/t}</code>
  There can be more attributes, only "d" is mandatory: <code>{t d="var1" foo="bar"}var2{/t}</code></p>
  
  <p>My problem is - if there are more tags on one line, just one result is returned, not all of them. What is returned (from test string below):
  <code>(u'single1', u'Required item3')</code></p>
  
  <p>What I expect to be returned:
  <code>(u'single1', u'required1')
  (u'single2', u'Required item2')
  (u'single3', u'Required item3')
  </code>
  I got stuck with this. It works with one tag per line but doesn't with more tags per one line.</p>
  
  <pre><code># -*- coding: UTF-8 -*-
  import re
  
  test_string = u'''
  &lt;span&gt;&lt;img src="img/ico/required.png" class="icon" alt="{t d="single1"}required1{/t}" title="{t d="single2"}Required item2{/t}" /&gt; {t d="single3"}Required item3{/t}&lt;/span&gt;
  '''
  
  
  re_pattern = '''
      \{t[ ]{1}       # start tag name
      d="         # "d" attribute
      ([a-zA-Z0-9]*)      # "d" attribute content
      ".*\}       # end of "d" attribute
      (.+)        # tag content
      \{/t\}      # end tag
  '''
  rec_pattern = re.compile(re_pattern, re.VERBOSE)
  
  res = rec_pattern.findall(test_string)
  if res is not None:
      for item in res:
          print item
  </code></pre>