Regex to get date from string -


i need regular expression date out of following string

anything-2011.01.17-16.50.19.xml 

is correct 1

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

?

this here checking format yyyy.mm.dd-hh.mm.ss

^(.*?)-(\d{4}(?:\.\d{2}){2}-\d{2}(?:\.\d{2}){2})\.xml$ 

but not verify if date or time valid value.

online check on regexr.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -