How to remove part of line after ":" in Notepad++?
6,970
Applying Zoredache answer in comment:
In "Search and Replace" dialogue box (Press Ctrl+H)
Under "Search Mode", Choose "Regular Expression"
Under "Find What: ", paste
^.*:
Click "Replace All"
Explanation of PCRE
^ Beginning of the string
. Any character
* Zero or more previous character (greedy)
Related videos on Youtube
Author by
Lucyfer
Updated on September 18, 2022Comments
-
Lucyfer almost 2 years
I want to delete first part of email:pass. Keeping everything after ":"
EXAMPLE: [email protected]:a59e1bbbdb3bd9d8e6be1651ac59ca5f
to
a59e1bbbdb3bd9d8e6be1651ac59ca5f-
Nullpointer42 over 10 yearsDo your lines only have a single :?
-
Zoredache over 10 yearsUse something like
s/^.*://g
. -
Nullpointer42 over 10 years@Zoredache Notepad++ doesn't support the /// syntax . . . you have to do find and replace dialogs, so it'd be more like
^.*:(.*)$
in the find box, and in the replace, you'd have\1
. Though I'll point out that the title to this question suggests wanting the exact opposite of what the question asks (remove the part after the :, as opposed to keeping it)
-