I want to select all text with same style token applied on notepad++. My goal is to remove all similarly styled words and sentences.

Notepad++ Screenshot


5 highlighting styles in Notepad++ serve for your visual navigation and currently they have no further use for processing. But you can manually add some text to them once you finished highlighting. That will enable possibility of automated processing.

You can do this:

  1. Find a character not used in your file. E.g. #. (Or in worst case, take for example this one: ¤)
  2. Surround your highlighted phrases with that character, e.g. Lorem¤Lorem¤.
  3. Using regex replace like ¤.*?¤ (replace with: empty) you can remove all marked sentences.

As an alternative, you can go without style tokens, clearing text immediately as you find it:

  1. Mark Lorem (or entire phrase) as selection.
  2. Press Ctrl+H to show find/replace dialog (what you marked is already inside).
  3. Clear content of Replace With box (if any).
  4. Click Replace all.

If you expect some more comfortable way, then I'd agree with you it is not implemented.

  • It seems like that feature is not implemented, but can hope for the same. Thank you for the tips. – lalthomas Jul 6 '16 at 10:39
  • @lalthomas – I updated the answer not to forget that viewpoint. So now it should be complete enough so you perhaps could accept it. – miroxlav Jul 6 '16 at 11:03

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.