title: Python regex findall
body: <p>I am trying to extract all occurrences of tagged words from a string using regex in Python 2.7.2. Or simply, I want to extract every piece of text inside the <code>[p][/p]</code> tags.
  Here is my attempt:</p>
  <pre><code>regex = ur&quot;[\u005B1P\u005D.+?\u005B\u002FP\u005D]+?&quot;
  line = &quot;President [P] Barack Obama [/P] met Microsoft founder [P] Bill Gates [/P], yesterday.&quot;
  person = re.findall(pattern, line)
  </code></pre>
  <p>Printing <code>person</code> produces <code>['President [P]', '[/P]', '[P] Bill Gates [/P]']</code></p>
  <p>What is the correct regex to get: <code>['[P] Barack Obama [/P]', '[P] Bill Gates [/p]']</code>
  or <code>['Barrack Obama', 'Bill Gates']</code>.</p>