[REGEX] Remove a section from a list.
Dafuq Xerath last edited by Dafuq Xerath
i have a big list of clan members, everything is like:
I just want now to remove the “@Email.com” part in the whole list. From @ to the next : can anything be deleted. Problem is, there are many different email providers, so i cant just replace every one :-/. But i need the Email Name to generate a tournament Email just not the “@EmailProvider.com”
Help would be amazing.
abelfourier last edited by abelfourier
@(?:[^.]+)\.COM #case insensitive
guy038 last edited by
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:
Select the Regular expression search mode
Finally, click on the Replace All button
Et voilà !
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
+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
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 :
You’ll have to uncheck the Match case option