# Selecting elements using two lists

ELCo = Alphabet["English"];
Characters[ToLowerCase[WordList[Language -> "English"]]];
Select[%, SubsetQ[ELCo, ToLowerCase[#1]] &];
LPr = Map[Sort, Map[DeleteDuplicates, %]];


This list LPr takes the English words and separates them into their characters while getting rid of duplication and capital letters. Now I make another list, basically the first five letters of the English language:

letters = Alphabet[][[1 ;; 5]];


Now I want to look at LPr and select all those words that are made of letters "a", "b", "c", "d", or "e" or the combination of them. I wonder how one would to this, I tried:

tmp = Table[SubsetQ[letters, LPr[[i]]], {i, Length[LPr]}];


and then,

Pick[LPr, tmp]


but this does not give me all those required words.

• LPr does not contain any reference to original words anymore so what exactly is a desired output? Words or your LPr entires? – Kuba Nov 7 '18 at 10:04
• LPr enteries that contains "a", "b", "c", "d", or "e" or the combination of them. – William Nov 7 '18 at 10:06
• I tried different approach and I get exactly what your Pick returns. So I guess you should explain why do you think your result is not correct. – Kuba Nov 7 '18 at 10:10
• If you run LPr you see for instance the second entry is {"a","h"} this element has "a" but was not picked. As I mentioned I need the return to contain contains "a" or "b" or "c" or "d" or "e" or the combination of them. – William Nov 7 '18 at 10:15

Select[ ContainsAny @ CharacterRange["a", "e"] ] @ LPr