$re = '/(\d+)\/(\d+)\/(\d+)|(\d+)-(\d+)-(\d+)/m';
$str = '9/18/2010 6:17:00 AM
05/21/2014
Date 2008-02-13
7/18/2016 9:54 PM
2000-04-20
Booked:1/16/2011 6:45:00 AM (2008-09-01 12:35:45 )
on January 3, 2008
on July 3, 2002
23 Mar 2017
5 Feb 2004
January 3, 2008
January 31, 2001
December 19, 2007
February 2009
February 30
- Feb 3, 2011
9 Jun 2010 ';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php