Community
    • Login

    Removing lines if contains X,X1,X2,X3

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 2.0k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ivica OrlićI Offline
      Ivica Orlić
      last edited by

      I have like 30 words which i want to delete, but its really annoying when i need mark 1 by 1 word or letter then delete it. Is there something where i can paste example if line contains:

      š
      Š
      đ
      Đ
      Č
      č

      To delete all lines who contains this letter above?

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Scott SumnerS Offline
        Scott Sumner @Ivica Orlić
        last edited by

        @Ivica-Orlić

        There are probably better ways to do it, but I think this will accomplish the goal:

        Invoke the Find dialog box and set it up this way:

        Find what: ^(?=.*[abc]).+\R     <-- replace abc with your list of characters
        Replace with:                     <-- make sure this is empty
        Search mode: Regular expression

        This regular expression will match the start-of-line, it will then assert that one of the characters from the set is on the line, then it will match out to the end of the line including the line-ending character(s). Once it has such a match, the replace operation replaces the entire thing with nothing since the replace-with box is empty, effectively removing the line.

        1 Reply Last reply Reply Quote 0
        • John BowmanJ Offline
          John Bowman
          last edited by

          A way without regular expressions you could bookmark each of the lines (use the mark tab on the find files dialog), then from the drop down menus use Search > Bookmark > Removed bookmarked lines.

          1 Reply Last reply Reply Quote 0

          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors