I need split string by commas and spaces, but ignore the inside quotes, single quotes and parentheses
$str = "Questions, \"Quote\",'single quote','comma,inside' (inside parentheses) space #specialchar";
so that the resultant array will have
[0]Questions [1]Quote [2]single quote [3]comma,inside [4]inside parentheses [5]space [6]#specialchar
my atual regexp is
$tags = preg_split("/[,\s]*[^\w\s]+[\s]*/", $str,0,PREG_SPLIT_NO_EMPTY);
but this is ignoring special chars and stil split the commas inside quotes, the resultant array is :
[0]Questions [1]Quote [2]single quote [3]comma [4]inside [5]inside parentheses [6]space [7]specialchar
ps: this is no csv
Many Thanks