Regex 记事本++;-仅匹配仅包含大写字母(或空格)的行

Regex 记事本++;-仅匹配仅包含大写字母(或空格)的行,regex,notepad++,Regex,Notepad++,因此,类似于[A-Z]的内容将匹配大写字母。如何匹配完全大写的行(或具有空格/类似空格的实体)?所以,在下面的例子中,我想消除第一行,保留所有剩余的 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

因此,类似于[A-Z]的内容将匹配大写字母。如何匹配完全大写的行(或具有空格/类似空格的实体)?所以,在下面的例子中,我想消除第一行,保留所有剩余的

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]
考虑到我的剧本写作技巧,也许用正则表达式删除所有文本更合适,但是嘿…

你可以使用
^([a-Z\s]+)$
正则表达式选择只包含大写单词(但没有标点符号)的行

如果要选择大写单词行,可以使用
\b[A-Z]+\b
regex


不要忘记选择匹配大小写选项

太好了,谢谢!这类东西有好的备忘单吗?