Each spec in the match pattern describes an element of the search list, which could be another list (as in HPWs example) but not a sublist. This is why you have to break up p into p,q.
Thanks again, guys! Do you ever have one of those days when your brain just doesn't want to understand something no matter how hard you try? I'm having one of those days today...
HPW's code works when p is a nested list and you want to find that nested list. Lutz' code works when you can specify the elements of list in advance. I want to specify the elements in advance but unnest them...
So all I need to do is to use *flat* to flatten the list stored in p... :-)
It took me too long to realise this. So it must be a time for a holiday!
(set 'p '(2 3))
(match (flat (list '* p '*)) numbers)
; or this
(letex (p '(2 3)) (match (flat '(* p *)) numbers))
the 'flat' solution is probably the best because it is independend from the number of members in 'p'. It will always work to find a sublist in another list, regardles of the length.