notepad++emeditor

How to remove all special symbols after : in EmEditor


Hello i need delete all special symbols like .,_- after symbol :

Example i got something like that

sfjsfajsafwp.pl:fsasaf.fssf
sfjsfajsafwp.pl:fsasaf.fssf
sfjsfajsafwp.pl:fsasaf.fssf.dgdg_

After this i expect:

sfjsfajsafwp.pl:fsasaffssf
sfjsfajsafwp.pl:fsasaffssf
sfjsfajsafwp.pl:fsasaffssfdgdg

Solution

  • Explanation:

    (?:         # non capture group
        ^           # beginning of line
        .*?         # 0 or more any character but newline
        :           # colon
      |           # OR
        \G          # restart from last match position
        (?!^)       # negative lookahead, make sure we are not at the beginning of a line
    )           # end group
    .*?         # 0 or more any character but newline
    \K          # forget all we have seen until this position
    [-.,_]+     # 1 or more any of these characters. 
                # You can add all the characters you want to delete
                # If you want to keep only letters, use [^a-zA-Z\r\n]+
    

    Screenshot (before):

    enter image description here

    Screenshot (after):

    enter image description here