How to parse multiple dates from a block of text in Python (or another language)

前端 未结 4 1529
一向
一向 2021-01-01 17:43

I have a string that has several date values in it, and I want to parse them all out. The string is natural language, so the best thing I\'ve found so far is dateutil.

4条回答
  •  情话喂你
    2021-01-01 18:31

    Why not writing a regex pattern covering all the possible forms in which a date can appear, and then launching the regex to explore the text ? I presume that there are not dozen of dozens of manners to express a date in a string.

    The only problem is to gather the maximum of date's expressions

提交回复
热议问题