python regex of a date in some text, enclosed by two keywords
- by Horace Ho
This is Part 2 of this question and thanks very much for David's answer. What if I need to extract dates which are bounded by two keywords?
Example:
text = "One 09 Jun 2011 Two 10 Dec 2012 Three 15 Jan 2015 End"
Case 1 bounding keyboards: "One" and "Three"
Result expected: ['09 Jun 2011', '10 Dec 2012']
Case 2 bounding keyboards: "Two" and "End"
Result expected: ['10 Dec 2012', '15 Jan 2015']
Thanks!