Regex to get date from string

前端 未结 3 783
盖世英雄少女心
盖世英雄少女心 2021-01-25 08:29

I need a regular expression to get date out of the following String

anything-2011.01.17-16.50.19.xml

Is this a correct one

^\\         


        
3条回答
  •  梦谈多话
    2021-01-25 08:44

    Try with:

    ^.*?-([0-9.]+)-([0-9.]+)\..*$
    

    You should also accept your recent questions.

提交回复
热议问题