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
^\\
This here is checking the format YYYY.MM.DD-HH.MM.SS
^(.*?)-(\d{4}(?:\.\d{2}){2}-\d{2}(?:\.\d{2}){2})\.xml$
But it does not verify if the date or the time is a valid value.
Online check on regexr.