I am trying to preg_match this " Expiration Date: 23-may-2012" except the "23-may-2012" could actually be returned in a bunch of ways.. Anyways any help would be great.
This is the code i am using to attempt to fetch. preg_match('/^Expiration Date: [A-z0-9_]/', $where, $output);
This should do it, no need for regular expression (no matter what format the date is in): <?php $string = str_replace('Expiration Date:', '', 'Expiration Date: 23-may-2012'); echo date("Y-m-d H:i:s", strtotime($string)); PHP: