in reply to how to select which words have Y and W

For your initial question, if you want words having both y and w, a character class or alternation is not sufficient. Try two regexes:
$ perl -e 'print join " ", grep { /y/ and /w/} ('red', 'cyan', 'yello +w', 'blue' )' yellow