I'm using grep to filter the Mac OS X dictionary words file (by default located at /usr/share/dict/words).
I want to use grep to retrieve all words four characters long. How do I do this?
My best guess for how to do this was:
grep [:alpha:]{4} words
But that returns zero results.
Trying to remember how much of regex language grep
supports... does
grep '^....$' words
work for you? Note that since you are searching a dictionary file, I'm not sure you need to restrict yourself to letters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With