Hello, Dafug Xerath,
Just to show that several regexes can achieve the same S/R, here is a second solution :
Open your file in Notepad++
Open the Replace dialog ( CTRL + H )
In the Find what: field, type in @(?:.+?)(?=:)
Leave the Replace with: EMPTY
Select the Regular expression search mode
Finally, click on the Replace All button
Et voilà !
NOTES :
This regex looks, first, for the literal character @.
At the end of the regex, the part (?=:), called a look-ahead, is a condition, that means that the overall match must be followed by a literal colon :.
So, the inner middle part, .+?, tries to match the shortest range of any character between the @ character, included and the : character, excluded.
The symbol + is a quantifier that means a maximum of characters, from 1 to n and the symbol ?, after the quantifier +, forces the regex engine to select the minimum range of any character, between the limits @ and :
As this range of characters is included in the syntax (?: .... ), this means that the range, of each line, will NOT be stored for later use, either in the Find or Replace regexes.
Finally, as the Replace dialog is empty, this range is just deleted, from each line !
Beware : if you prefer to use the abelfourier’s search regex, the correct regex is, obviously :
@(?:[^.]+)\.COM
You’ll have to uncheck the Match case option
Best Regards,
guy038