Well, though this is rather distant from a general solution, it does answer the OP's stated question so no downvote even though the regex is scarcely more than an identity.
It could be generalized a bit:
$string =~ s/\|(\S+)\s([^-|]+)[-|](x+)[-|](x+)[-|](x+)[-|](x+)[-|](x+)[-|](x+)[-|](x+).*/$1,$2,$3,$4,$5,$6,$7,$8,$9,/;
But that's still far from general, relying on "x" rather than [A-Za-z0-9]+ -- which I suspect comes closer (but still clumsily) to OP's "real" question." See, for example, ikegami's reply.
Update: Linkified to clarify my "this" | [reply] [d/l] [select] |
Granted, I should probably have been more helpful, for instance Anonymous Monk does this, but I have a tendency to get lazy/sloppy/careless when giving out fish.
Confucius says kill mosquito unless cannon
| [reply] |