silent wrote:i don't think it was compiled with support for the # operator...
It's not an operator. It's just the symbol sneakyimp picked to mark the start and end of the regexp. Usually it's /, but there's no law that says it has to be.
I'd be more likely to start with something like
$q_and_a = preg_split("/\n(?=\d)/", $haystack);
Assuming that each answer and each question is on a single line. (That really would be easier, otherwise it could get hairy trying to tell where one answer leaves off and the next begins.
I'd prefer to split on a double-linebreak (and in PHP5 that wouldn't even need regular expressions), and if you know what line-ending convention (Unix vs. Windows) this thing will be running under that's what I'd go for.
In fact, I'd probably go for that anyway:
$linebreak="
";
preg_split("/$linebreak$linebreak/", $haystack);