I would like to select nested lists out of a master list based on certain string pattern as in the following example:
lis = {{a, b, c, d}, {xy, y, z, w}, {e, f, g, h}, {xz, f, g, h}};
I would like to create a list with all nested lists starting with x*
in the fist position.
I tried the following functions:
Cases[lis, {q_, r__} /; StringMatchQ[q, "x*"] -> {q, r}]
or
Select[lis2, First[#] == x &]
Both do not work.
Does anyone can give me a hint?
lis
or you just want to use string patterns for symbols? $\endgroup$