title: Python regular expression for extracting month and year
body: <p>I want to extract month and year from string. For example:</p>
  
  <p>If I have a string <code>From August 2017 - September 2018</code> then I should get <code>'August 2017'</code> and <code>'September 2018'</code> as two groups. I tried the following:</p>
  
  <pre><code>import re
  
  regex = r'(\b\d{1,2}\D{0,3}\b-)?\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|(Nov|Dec)(?:ember)?)\D?(\d{1,2}\D?)?\D?((19[7-9]\d|20\d{2})|\d{2})'
  experience = re.findall(regex, 'August 2017 - Sep 2018')
  print(experience)
  </code></pre>
  
  <p>This returns <code>[('', '', '20', '17', ''), ('', '', '20', '18', '')]</code></p>
  
  <p>I also tried <strong>re.search</strong>:</p>
  
  <pre><code>import re
  
  regex = r'(\b\d{1,2}\D{0,3}\b-)?\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|(Nov|Dec)(?:ember)?)\D?(\d{1,2}\D?)?\D?((19[7-9]\d|20\d{2})|\d{2})'
  experience = re.search(regex, 'August 2017 - Sep 2018')
  print(experience.group())
  </code></pre>
  
  <p>This returns only <code>August 2017</code></p>
  
  <p>Can we have some regex to extract both the dates?</p>