@Terry-R said in Regex: Find whole words that have only uppercase letters in text:
I did some more testing and can see it will fail in some situations.
I have had more time to consider how it might work and also to look at “classes”. This next solution is I think working correctly and will also allow for words with a ' in them such as DON’T.
Find What:(?-i)\b[[:upper:]](?:[[:upper:]]|')+\b
I had to start it with a look for an upper character, otherwise it would select just a ' by itself. You may also want to extend to include a - if you need to. If adding a - then it becomes (?-i)\b[[:upper:]](?:[[:upper:]]|'|-)+\b.
Terry
492d7dc6-504f-485b-a76b-1d51461b5f1f-image.png