Regular expression to find unknown acronyms [closed]
-
03-07-2021 - |
Question
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)/
Solution
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow