1 Answer 1

2

I think the easiest way to accomplish this is a regular expression replace.

  • Press CTRL+H to bring up the Replace window.
  • In the "Find What:" box, type a regular expression to match the double email addresses. I used the expression .*@.*@.*
  • Leave the "Replace with" box empty to clear out these lines.
  • In the "Search Mode" box, select the "Regular expression" button. Make sure ". matches newline" is unchecked.

Note, there are much better email address regular expressions. The one I provided simply looks for two @ symbols on the same line with 0 or more characters before, between, and after those @ symbols.

UPDATE: In response to the comment of matching 2 email addresses next to each other, this is much more difficult to do as there's no straightforward way to determine where the first email ends and the 2nd begins. For the exact case given in the comment, you can use the "Find what" (.*?\@.*?\.com)(.*@.*:.*) with a "Replace with" box value of \2. (Again, there are much better expressions you can use, but this is quick and dirty).

This regex find an email address ending in .com in the first RegEx match, and another email address, colon, and additional text is the 2nd match. The "Replace with" will leave the 2nd match (the one you are looking for).

1
  • but what if the double email in the same line before : example [email protected]@yahoo.com:password to remove that kind ?
    – user677589
    Aug 16, 2017 at 3:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .