I am a newbie user in mathematica. Here is my problem:
For example, I have a nested list:
lst = {{1, 0, 0}, {0, 1, 1}, {2, 0, 1}, {1}, {0,3}}
I want to only output those sublist whose elements are 0 or 1. The above list's output should be:
{{1, 0, 0}, {0, 1, 1}, {1}}
I can get the list that satisfies my conditions with this:
lst /. x:{(1 | 0) ..} :> x
But how can I get the converse of the pattern? like this:
lst /. x:NOT{(1 | 0) ..} :> Sequence[]
So that i can get the result in one stroke.
thanks!