added regex for date

This commit is contained in:
Roland Gruber 2004-11-08 19:25:50 +00:00
parent 92169bbb5d
commit a1fcb011bf
1 changed files with 3 additions and 0 deletions

View File

@ -488,6 +488,9 @@ function get_preg($argument, $regexp) {
case 'macAddress':
$pregexpr = '/^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$/';
break;
case 'date':
$pregexpr = '/^((0[1-9])|([1-2][0-9])|30|31)\\-((0[1-9])|(1[1-2]))\\-[1-3][0-9][0-9][0-9]$/';
break;
}
if ($pregexpr!='')
if (preg_match($pregexpr, $argument)) {