What I have found so far is this
preg_match_all(\"/\'[^\']+\'|[^,]+/\", $input, $output);
Its supposed to find commas outside simple quotes, i
To match all the commas which was outside the single quotes and double quotes.
(?s)(?:(?
DEMO