First off, this is homework and unfortunately I have to use egrep (and not with -w or anything of the like).
I need my grep to return lines that have exactly 5 or 6 upper case letters.
Doing egrep [A-Z]{5,6} .filename returns 5 and 6 letter words, but also unfortunately also more letter words than that.
So I for example in this list:
ASK
roger ROBERT gulliver
tom THOMAS
JONATHAN moore
MELISSA tenant
I need it to return only ROBERT and THOMAS.