fork(25) download
  1. <?php
  2.  
  3. $input_string = "yes today is 2013-10-24";
  4. if(preg_match("/\d{4}-\d{2}-\d{2}/", $input_string, $match))
  5. {
  6. print_r($match);
  7. }
  8. else
  9. echo "not matched";
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 2013-10-24
)