Search code examples
notepad++edit

How do I mass edit serval lines with Notepad++?


is there any way I can delete words in a specific line, after a specific character is there? Example:

12345:6789

tjweaiv:tkojeatkasdf

1237ujb:5bji11s

kv120ki12:tj3i2tm23

is there a way that I can delete everything that comes after : ?


Solution

  • You can try the following find replacement:

    Find:

    ^(.*:).*$
    

    Replace:

    $1
    

    Choose the replace all option if you want to do this replacement on every line. Also, make sure that you are in regex mode when doing this replacement, otherwise it won't work as intended.

    Update:

    If you wanted to retain everything coming before the first colon, then you could make the find regex non greedy and use this:

    ^(.*?:).*$