Member-only story
How to Extract Date Information from a String with Python? (Basic NLP in 3 Minutes)
3 min readMar 13, 2021
We will explore how to use the Regular Expressions Regex library in python to perform simple NLP / text mining tasks such as extracting date information from a string.
There are many conventions to write a date, e.g.:
24–11–2020
24/11/2020
24/11/20
11/24/2020
24 Nov 2020
24 November 2020
Nov 24,2020
November 24, 2020
5–11–2020
5/11/2020
5/11/20
11/5/2020
5 Nov 2020
5 November 2020
Nov 5,2020
24–9–2020
24/9/2020
24/9/20
9/24/2020
24 Sep 2020
24 September 2020
If any one of the above dates appears in a sting,
how can we extract date information…