title: pandas str.extract with additional logic (lambda ?)
body: <p>I have many types of dates in the text:</p>
  
  <ul>
  <li>04/20/2009;</li>
  <li>04/20/09;</li>
  <li>4/20/09;</li>
  <li>4/3/09</li>
  <li>04-20-2009;</li>
  </ul>
  
  <p>And many more.</p>
  
  <p>I'm working on a RegEx (or several RegEx's) to extract the dates.</p>
  
  <p>Lucky pandas has a very useful function called extract, for example this extracts very well most of my dates:</p>
  
  <pre><code>df['text'].str.extract(r'(\d{1,2})[\/-](\d{1,2})[\/-](\d{1,4})', expand=True)
  </code></pre>
  
  <p>As you can see above, I have 3 capture groups. This creates 3 columns: month, day, year.</p>
  
  <p>Is it possible somehow to run a lambda on them and create a single column?</p>
  
  <p>The same way you use lambdas on "replace"</p>
  
  <pre><code>df['text'].str.replace(r'(\w+day\b)', lambda x: x.groups()[0][:3])
  </code></pre>