I have several strings that I want to split using different delimiters such as ",{}()
$ppl[0] = "Balko, Vlado \"Panelбk\" (2008) {Byt na tretom (#1.55)}";
$ppl[1] = "'Abd Al-Hamid, Ja'far A Two Hour Delay (2001)";
$ppl[2] = "'t Hoen, Frans De reьnie (1963) (TV)";
$ppl[3] = "1, Todd \"5 Deadly Videos\" (2004)";
$ppl[4] = " \"School voor volwassenen\" (1960) {(#1.7)}";
So far I was using this pattern for 1 and 2:
$pattern = '#[,\t()]+#'
although it's leaving some undesired entries at the end [ 4--> ) ]:
Array ( [0] => 'Abd Al-Hamid [1] => Ja'far [2] => A Two Hour Delay [3] => 2001 [4] => )
But when I try to adapt it capture text inside quotes I get a lot of empty spaces in the middle of the array which mess up the rest of the things. I could of course remove the empty spaces from the array and fix up the keys but I'd rather have a correct regex.
The delimiters I need are
" , \t () {}
.
I tried
["(.*?)"]
to get text between quotes but that leaves me with empty values in my array. Any ideas?