title: Regular Expression in Python: search() vs findall() for (\w)+
body: <p>I have created a regular expression as:</p>
  
  <pre><code>agentRegex = re.compile(r'Agent (\w)+')
  </code></pre>
  
  <p>And then I performed <code>search()</code> operation as:</p>
  
  <pre><code>agentRegex.search('Agent Alice told Agent Carol that Agent Eve knew Agent Bob was a double agent.').group()
  </code></pre>
  
  <p>I obtained <code>'Agent Alice'</code> as output. </p>
  
  <p>But when I performed <code>findall()</code> operation:</p>
  
  <pre><code>agentRegex.findall('Agent Alice told Agent Carol that Agent Eve knew Agent Bob was a double agent.') 
  </code></pre>
  
  <p>The output was <code>['e', 'l', 'e', 'b']</code>.</p>
  
  <p>Shouldn't the output be <code>['Alice Agent', 'Agent Carol', 'Agent Eve', 'Agent Bob']</code>? </p>