Domanda

I need a regular expression that will pick out lines with ALL CAPS or unknown acronyms.

ie: something like

/[A-Z]{2,}/ 

combined with

/(?!USA|UK|TLA)/
È stato utile?

Soluzione

You mean something like this?

\b(?!(?:USA|UK|TLA)\b)[A-Z]{2,}\b

See it here on Rubular

\b is a word boundary to ensure that it will find complete words.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top