I am using the preg_split function in PHP in order to create one array containing several different elements. However, I want to exclude a string which happens to contain one of the elements that I'm preg_splitting by.
$array['stuff'] = preg_split('/\[#]|\ & |\ & |\& |\&|\ &|\ > |\ > |\> |\>|\ >|\ & |\ & |\& |\&|\ &|\ \/ |\ \/ |\\/ |\\/|\ \/|\ > |\ > |\> |\>|\ >|\ , |\ , |\, |\,|\, |\ :: |\ :: |\:: |\ ::|\::|\ ::|\ : |\ : |\: |\:|\ :|\ - |\ - |\- |\-|\ -/', $array['stuff'] ) ;
What I would like to do is to exclude a string such as 'foo-bar' from being matched for a split because it contains a dash. 'foo-bar' would need to be an exact match for my purposes.