I\'m trying to validate a date input by the use of regex.
if(!preg_match(\"/^[0-9]{4}\\/[0-9]{2}\\/[0-9]{2}$/\", $_POST[\'variant\'][\'sales_start\'])) {
Also, use PHP function checkdate() in order to validate your date according to Gregorian calendar - http://php.net/manual/en/function.checkdate.php
checkdate()