gabordemooij/redbean — Issue #117: Is there an issue in matchesDateTime function
Author: mjlefevre
Created: 2011-12-13 20:53:15+00:00
State: open

function matchesDateTime($value) {
$pattern = "/^([0-9]{2,4})-([0-1][0-9])-([0-3][0-9]) (?:([0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/";
return (boolean) (preg_match($pattern, $value));
}

Am I correct in thinking with this regular expression and the space in the middle of it.
That '2010-09-01' will return false and '2010-09-01 ' will return true ?