Extracting 4 letter words from a wordlist

All I wanted was to extract only the 4 letters words from /usr/share/dict/words. It tooks me a full 10-minutes to figure out the regex for it to work with egrep. $ egrep '^[A-Za-z]{4}$' /usr/share/dict/words  Note to self: Must practice regex syntax more often. Update (a slightly cleaner way, from @gabegundy): $ egrep '^[a-Z]{4}$' /usr/share/dict/word 

November 6, 2010 · 1 min