Community
    • Login

    remove lines containing SHA-1 HASH

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 694 Views
    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.
    • ani rodetA Offline
      ani rodet
      last edited by

      I have many lines with SHA-1 HASH, how can I delete them?

      user:cd7678bcfc4a632943b6d79aaacbab33e0e23da3
      wydawca.lead.network:hots:ip
      name:7ce0359f12857f2a90c7de465f40a95f01cb5da9:hots
      f7ff9e8b7bb2e09b70935a5d785e0cc5d9d0abf0
      tracking.klickthru.com:123.45.160.12

      to

      wydawca.lead.network:hots:ip
      tracking.klickthru.com:123.45.160.12

      thanks to you

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by guy038

        Hello @ani-rodet and All,

        Just one regex S/R and you’re done :-)

        So :

        • Open the Replace dialoag ( Ctrl + H )

        • SEARCH (?-s)^.*[[:xdigit:]]{40}.*\R

        • REPLACE Leave EMPTY

        • Tick the Wrap around option, if necessary

        • Select the Regular expression search mode

        • Click once on the Replace All button or several times on the Replace button

        Notes :

        • The first part (?-s) ensures that the regex char . will match a single standard character, only ( not EOL ones )

        • Then the part ^.* searches for the longest, even EMPTY, range of characters till …

        • Now, the part [[:xdigit:]]{40} looks for, exactly, 40 hexadecimal characters

        • The final part .*\R selects all the remaining characters of current line with its like break ( \R )

        • The overall match is just deleted as the replacement zone is empty

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 3
        • ani rodetA Offline
          ani rodet
          last edited by

          thanks very much

          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