Is there a pattern to match a list of lists, containing at least one list, with each list containing at least one element?
In the Mathematica documentation it says that the pattern
x:{___List}
will match a list of lists. This is true, but it also matches {}, which is a list of zero lists (or zero anything). To make sure there is at least one list in my list of lists I can remove one of the underscores to change BlankNullSequence to BlankSequence, i.e. switch to
x:{__List}
which no longer matches {}. It does, however, match {{}}. How can I also guarantee that each matched sublist is non-empty? Is this even possible, or should I be checking for it programmatically within the Module to which I'm passing arguments of this form?
x).{__}stands for a list with one or more elements, and..is short form ofRepeatedwhich means one or more of the preceding expression. Please read all four documentation pages that I link to above, then return with any further questions. – Mr.Wizard Feb 03 '12 at 23:49