title: Using Python and Regex to extract different formats of dates
body: <p>I have the following code to match the dates </p>
  
  <pre><code>import re
  date_reg_exp2 = re.compile(r'\d{2}([-/.])(\d{2}|[a-zA-Z]{3})\1(\d{4}|\d{2})|\w{3}\s\d{2}[,.]\s\d{4}')
  matches_list = date_reg_exp2.findall("23-SEP-2015 and 23-09-2015 and 23-09-15 and Sep 23, 2015")
  print matches_list
  </code></pre>
  
  <p>The output I expect is</p>
  
  <pre><code>["23-SEP-2015","23-09-2015","23-09-15","Sep 23, 2015"]
  </code></pre>
  
  <p>What I am getting is:</p>
  
  <pre><code>[('-', 'SEP', '2015'), ('-', '09', '2015'), ('-', '09', '15'), ('', '', '')]
  </code></pre>
  
  <p>Please check the link for <code>regex</code> <a href="http://regexr.com/3ccth">here</a>.</p>