title: How to extract date from string using Python 3.x
body: <p>I require to find out the phone bill due date from SMS using Python 3.4 I have used dateutil.parser and datefinder but with no success as per my use-case.</p>
  
  <p>Example: sms_text = "Your phone bill for Jun'17 of Rs.72.23 due on 15-07-2017 has been sent to your regd email ID abc@xyz.com. Pls check Inbox"</p>
  
  <p>Code 1:</p>
  
  <pre><code>import datefinder
  due_dates = datefinder.find_dates(sms_text)
  for match in due_dates:
      print(match)
  </code></pre>
  
  <p>Result: 2017-07-17 00:00:00</p>
  
  <p>Code 2:</p>
  
  <pre><code>import dateutil.parser as dparser
  due_date = dparser.parse(sms_text,fuzzy=True)
  print(due_date)
  </code></pre>
  
  <p>Result: ValueError probably because of multiple dates in the text</p>
  
  <p>How can I pick the due date from such texts? The date format is not fixed but there would be 2 dates in the text: one is the month for which bill is generated and other the is the due date, in the same order. Even if I get a regular expression to parse the text, it would be great.</p>
  
  <p>More sample texts:</p>
  
  <ol>
  <li>Hello! Your phone billed outstanding is 293.72 due date is 03rd Jul.</li>
  <li>Bill dated 06-JUN-17 for Rs 219 is due today for your phone No. 1234567890</li>
  <li>Bill dated 06-JUN-17 for Rs 219 is due on Jul 5 for your phone No. 1234567890</li>
  <li>Bill dated 27-Jun-17 for your operator fixedline/broadband ID 1234567890 has been sent at abc@xyz.com from xyz@abc.com. Due amount: Rs 3,764.53, due date: 16-Jul-17.</li>
  <li>Details of bill dated 21-JUN-2017 for phone no. 1234567890: Total Due: Rs 374.12, Due Date: 09-JUL-2017, Bill Delivery Date: 25-Jun-2017,</li>
  <li>Greetings! Bill for your mobile 1234567890, dtd  18-Jun-17, payment due date 06-Jul-17 has been sent on abc@xyz.com</li>
  <li>Dear customer, your phone bill of Rs.191.24 was due on 25-Jun-2017</li>
  <li>Hi! Your phone bill for Rs. 560.41 is due on 03-07-2017.</li>
  </ol>