I have the following paragraphs :
This is paragraph #1
New-York, London, Paris, Berlin
Some other text
End of paragraph
This is paragraph #2
London, Paris
End of paragraph
This is paragraph #3
New-York, Paris, Berlin
Some other text
End of paragraph
This is paragraph #4
End of paragraph
This is paragraph #5
Paris, Berlin
Some other text
End of paragraph
How can I, with a regex, match the paragraphs containing e.g. New-York (#1 and #3) or London (#1, #2) ? or even New-York AND Berlin (#1, #3) ?
I have found an answer in S.O.
How match a paragraph using regex
which allows me to match the paragraphs (all the text between two blank lines).
But I cannot figure (my regex skills are… limited) how to match the paragraphs containing a specific pattern, and only those paragraphs.
Thanks in advance for your help
NB : the idea is to use the answer in the Editorial IOS app to fold the answers NOT containing the pattern.