I have data with plenty of text strings where key words and phrases are capitalised. I want to extract the capitalised bits, but NOT breaking down capitalised phrases into their constituent parts. Some pseudocode explains best:
text = "Here is some text where KEY words and EXTENDED PHRASES are in UPPER CASE.";
< SOME ELEGANT CODE EXTRACTS...>
{"KEY", "EXTENDED PHRASES", "UPPER CASE"}
...but does not break the extended phrases into their constituent parts. So the result is NOT...
{"KEY", "EXTENDED", "PHRASES", "EXTENDED PHRASES", "UPPER", "CASE", "UPPER CASE"}
N.B. - The extended capitalised phrases can be of any length.
I can think of plenty of clumsy ways of doing this (in fact, these days I am getting pretty good at clumsy). Has anyone got an elegant way?
Thanks in advance
Brad