<?php $subject = "2010-12-30"; $pattern = '/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/'; if(preg_match($pattern,$subject,$m)) print_r($m); ?>