Finding and deleting entire paragraphs.
-
I would like to find all paragraphs in a document that do not contain “2016” and delete them. Is there an expression for that?
-
Probably but can you be precise as to what your meaning of paragraph is?
-
Sorry for not replying earlier. I’ll watch more closely from now on. By paragraph I mean a string between paragraph markers. In notepad++ they show as two black boxes that say “CR LF”
-
Well, most people call what you’ve defined “lines” and not “paragraphs”, but that’s why I asked.
You can remove all lines not containing 2016 as follows:
Find what:
^((?!2016).)*\R
Replace with: make sure this is empty
Search mode: Regular expression -
That works. Thank you very much!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login