$re = '/(?<Date>[\d\/]+)\s*(?<Reason>\w+)\s*(?<ReferalFrom>\w+\s\w+)\s*(?<ReferalTo>\S+)\s*(?<Speciality>\w+\s\w+)\s*(?<StartDate>[\d\/]+)\s*(?<EndDate>[\d\/]+)\s(?<Allowed>\d+)/m';
$str = '5/20/2022 PT AUTH PENDING Gupta,Saroj Sports Medici 05/20/2022 05/20/2023 0';
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