1

Here's some text:

test
HELLO
999
help
HOW ARE YOU
buy
aaa
H
d

I need to remove all lines without uppercase. The result must be

HELLO
HOW ARE YOU
H

I tried M-x flush-lines [a-z] RET but the output was

999

What am I missing?

1
  • Just a minor observation with respect to the way you pose the question. Do the screenshots add any significant information? I don't think so.
    – aadcg
    Sep 24 at 8:43
1

I'll solve it using a dual strategy.

First we say that case matters.

M-: (setq case-fold-search nil) RET

Then we keep the lines containing upper case.

M-x keep-lines RET [[:upper:]] RET

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.