Python - finding date in a string

前端 未结 5 1979
误落风尘
误落风尘 2021-02-20 12:24

I want to be able to read a string and return the first date appears in it. Is there a ready module that I can use? I tried to write regexs for all possible date format, but it

5条回答
  •  花落未央
    2021-02-20 12:33

    As far as I can tell, there is no such module in standard python library. There are so many different date formats that it's hard to catch them all. If I was you, I will turn to Regex. refer to this page

提交回复
热议问题