See First word, which has a similar problem. Maybe you can adapt the answers given there to your problem?
In reply to Re: pattern matching from an array to an array of arrays
by Corion
in thread pattern matching from an array to an array of arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |