$re = '/^(?:.+?,){4}(?P<requestapplicationlabel>.+?),(?<requesttransactionid>.+?),.+?,(?<callingapplication>.+?),(?<calltype>.*?),(?<function>.+?),/m';
$str = '2014-06-04 23:42:42,115,,,1401889361349,MetricLogger,TDI_CLOUDCSX_1,1401889361349,hymlxsdfbpe11_1401889362113_11537,,RetrieveIdentityDetails,148
2014-06-04 23:42:36,427,,,0dedf85a-fbdb-43cb-b9f1-d4a0f636ab97,MetricLogger,TELSTRA_PREPAIDACTIVATION_STRATEGIC,0dedf85a-fbdb-43cb-b9f1-d4a0f636ab97,chslxsdfbpe05_1401889356427_2871,,CCandB.CreateNewBillingAccount,2983';
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