Argh
Argh

Reputation: 89

Notepad++ - match only lines that only contain CAPITAL LETTERS(or whitespace)

So, something like [A-Z] will match capital letters. How can I match lines that are entirely in capitals(or have whitespaces/whitespace-like entities)? So, in the example below, I want to eradicate the first line and keep all the rest...

EVIL WIZARD
Ye insolent peasant swine!
By the demonic creatures
Resident in my ancient beard
Ye shall know true misery
Before this day is done!

[EVIL WIZARD laughs maniacally as hordes of rodents eat everything in sight]

Given my screenplay writing skills, maybe a regex to remove all the text would be more appropriate, but hey...

Upvotes: 2

Views: 2782

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 626748

You can use ^([A-Z\s]+)$ regex to select lines that only contain words in UPPERCASE (but no punctuation).

enter image description here

If you want to select lines with uppercase words, you can use \b[A-Z]+\b regex.

enter image description here

Do not forget to select Match Case option!

Upvotes: 3

Related Questions