title: Parse multiple date formats to a specific format
body: <p>In my application user can enter dates in format of dd/mm/yy  with date separator variations(like they can use /,- or space as a seperator). They can also put 4 digit year or 2  digit year and they can also enter 3 letter code for a month or a 2 digit code for month. Once I have the date from the user I want to validate that the format is a valid date format and then convert it to '%d-%b-%Y'. In the below function I am validating the date format, but I am not sure how to handle all the mixed date separator formats like 01/12 2013, 01-12 13, 01 12/2013 etc. There can be loads of these </p>
  
  <pre><code>def validate_date(date_str):
      formats = ['%d-%b-%Y', '%d-%b-%y', '%d-%m-%Y', '%d-%m-%y',
                 '%d/%m/%Y', '%d/%m/%y', '%d/%b/%Y', '%d/%b/%y',
                 '%d %m %Y', '%d %m %y', '%d %b %Y', '%d %b %y',
                  '%d%m%Y', '%d%b%y', '%d%b%Y', '%d %b/%Y'] 
      data = None
  
      for fmt in formats:
          try:
              dateValue = datetime.datetime.strptime(date_str, fmt).date()
              data = dateValue
              break
          except ValueError:
              pass
  
      if data is None:
      # invalid date format
  </code></pre>