what’s the simple time format regex for use on preg_match function
I try to find a regex for a time format exact :2012/05/23-23:56
what’s the simple time format regex for use on preg_match function I try to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The simplest way would be
But that would be only a rough syntactic match. You might still want to make sure it is in fact a date and time. You can use
DateTime::createFromFormatfor that with a format string like the following (untested):