Seems like this is rather simple, but I\'m having trouble.
I have a text document that looks, for example, like this:
This is a
TEXT DOCUME
An "old school" RE would be fewer characters:
grep -o '[A-Z][A-Z]*' Untitled.txt
It uses the -o
option to Only print matching words and matches against uppercase A through Z.
Adding -w
to search words and -E
to invoke the Extended regular expressions allows this one that is even shorter:
grep -woE '[A-Z]+\>' Untitled.txt