I want to delete first part of email:pass. Keeping everything after ":"

EXAMPLE: test0@aol.com:a59e1bbbdb3bd9d8e6be1651ac59ca5f

  • Do your lines only have a single :?
    – ernie
    Dec 11 '13 at 0:44
  • 1
    Use something like s/^.*://g.
    – Zoredache
    Dec 11 '13 at 0:52
  • @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)
    – ernie
    Dec 11 '13 at 1:02
  • You’ll definitely want to use a regular expression, but the specific expression that you will need to use will depend on your specific data. For example, if all of your lines are exactly like your sample, then something as simple as ^.+:(.+)$\1 would work. If that was a simplified example, then you would need to account for the variations, which could get complex (the full regex for email addresses alone is mind-boggling).
    – Synetech
    Dec 11 '13 at 1:53

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)


Try using replace with a regular expression (check box down on the left). The find field could be something like:


Translated it means From the beginning of the line (^) take everything that isn't a colon ([^:]+) and the colon delimiter (:).

The replace field would be empty.

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.