I am using dateparser
modules to parse some human readable text to python date time objects. For now I am having a list of regex strings and applying on input strings to find out is there any matches.
I want to use full list of regex list that dateparser
uses, is there way to get the list or is there a way to work on input string only.
I am having list like below
date_regex = ['[0-9]+ days', 'yesterday', '[0-9]+ weeks', 'a week', '1 week', 'last week', '[0-9]+ months', 'a month', '1 month', 'year']
but using dateparser
can parse strings like 1 year ago
, last 3 mins ago
. So I would like to take all available regex that dateparser
using.
My input contains lot of text also included with date/time related strings as well. So I need to extract those and convert them into date time object using dateparser
.
Update with example
input="I booked a movie 4 days ago, but planned last week"
.
I need to extract 4 days ago
and last week
. I thought of applying all available regex strings in dateparser
.