Home > Mobile >  Filter only 1st paragraph starting always with capital letters and ending with two newlines
Filter only 1st paragraph starting always with capital letters and ending with two newlines

Time:10-10

I'm trying to filter out only paragraph which must start with >FIGURE< word and must end before 2 new lines (\n\n) Here's the text I'm working with :

FIGURE
     hello this a test.
     how
     are you
     I am fine, 123!.


OUT THERE
     This is ridiculous.
     Don't believe it.
     Don't believe it.

I tried this:^[A-Z ] [\w ,!.'] but couldn't filter next paragraph starting with >OUT THERE<`.

CodePudding user response:

You could capture until a newline character is encountered that is not followed by a space (or the end of the input is reached).

enter image description here

  • Related