Example:
$string = \"This is some text written on 2010-07-18.\"; preg_match(\'|(?\\d\\d\\d\\d-\\d\\d-\\d\\d)|i\', $string, $arr_result); print_r(
Try this:
$string = "This is some text written on 2010-07-18."; preg_match('|(?\d\d\d\d-\d\d-\d\d)|i',$string,$arr_result); echo $arr_result['date'];