B
Brandon Metcalf
I'm trying to come up with a regexp to match a string containing the
date and time in the format:
yyyy-mm-dd hh:mm:ss
with either the date or time part being optional but not both and the
":ss" part always being optional. I have the following which falls short
in a number of ways:
/^(\d{4}(-\d{1,2}){1,2}\s+)?(\d{1,2}
\d{2}){1,2})?$/
Is there a way to do this with one regexp?
Thanks.
date and time in the format:
yyyy-mm-dd hh:mm:ss
with either the date or time part being optional but not both and the
":ss" part always being optional. I have the following which falls short
in a number of ways:
/^(\d{4}(-\d{1,2}){1,2}\s+)?(\d{1,2}
Is there a way to do this with one regexp?
Thanks.