string
T1 - X1(1), 7
T2 - C2(-9), -15
T3 - Y2(1), 3
T5 - C2(-1), 100
regexp used for preg_split
$pattern = "/[-,#\n#()]/";
preg_split($pattern, $string);
In above regular expression it is considering the hyphen space same as minus in front of a number.
Final Result Required
array having after preg_split and trim space ["T1","X1","1","7","T2","C2","-9","-15","T3","Y2","1","3","T5","C2","-1","100"]
What changes can I make in the regexp pattern to achieve the final result required?