Fixed preg_match issues

Added closing PHP to end of file also