grep whole words made of only uppercase letters

前端 未结 5 1962
[愿得一人]
[愿得一人] 2021-01-23 04:23

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

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-23 05:06

    You miss * and also \w is any word character. Correct regexp is:

    \<[[:upper:]][[:upper:]]*\>
    

    \< \> match word boundaries

提交回复
热议问题