1

I need to find and keep all strings that are in between <strong>string I want to keep</strong> tag and remove all other text (includes <strong></strong>)

Is it possible to do it in Notepad++, please advise.

Ronaldinho Learn Coding
  • 13,254
  • 24
  • 83
  • 110
  • I'll just leave this here. http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – rockerest Jan 06 '14 at 16:18

1 Answers1

0

Find:

.*?<strong>(.*?)</strong>.*?

Replace with:

\1

NOTE You should check . matches newline checkbox.

enter image description here

result:

enter image description here

Use \1\n if you want following as result:

enter image description here

falsetru
  • 357,413
  • 63
  • 732
  • 636
  • Thanks for assisting me! I applied your method and it worked almost perfectly, only thing is that there are still remaining text after the last found string, like this: this is the last found string we're the rest of document and we are still here. – Ronaldinho Learn Coding Jan 06 '14 at 17:30
  • 1
    @RonaldinhoState, Use `.*?(.*?).*?|.*$` for pattern to remove trailing text. – falsetru Jan 06 '14 at 17:38