remove lines containing SHA-1 HASH
-
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.12to
wydawca.lead.network:hots:ip
tracking.klickthru.com:123.45.160.12thanks to you
-
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 aroundoption, if necessary -
Select the
Regular expressionsearch mode -
Click once on the
Replace Allbutton or several times on theReplacebutton
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,40hexadecimal characters -
The final part
.*\Rselects 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
-
-
thanks 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