Hi, @melad-eissa,
In my previous post, I give an example of the modifications needed :
INITIAL : sissleib6930 @ stu.howardcollege.edu : Not-Engaged
EXPECTED : sissleib6930 @ stu.howardcollege.edu : Not-Engaged :Email. stu.howardcollege.edu
Seemingly, we need the part between the @ and the : chars because this part has to be re- written at the end of line, too
However, the part before the @ char does not change at all. So we can represent the goal as below ( note that Space chars are irrelevant )
The OVERALL match = $0
/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\
INITIAL Text @ stu.howardcollege.edu : Not-Engaged
EXPECTED Text @ stu.howardcollege.edu : Not-Engaged :Email. stu.howardcollege.edu
\___________________/ \_____/ \___________________/
Group 1 String Repeated Group 1
SEARCH regex @ ( .+ ) : .+
REPLACEMENT regex $0 :Email. \1
Now, the exact syntax of this regex S/R is rather obvious :
SEARCH (?-s)@(.+):.+
REPLACE $0:Email.\1
And will change the initial text :
ernestobaltar@yahoo.com:Golden-Ball
amaury.tenaille@epfedu.fr:SilverBall
Inspirit@staplesnet.us:Copper_Ball
Matthewsk@mail.montclair.edu:Encourage
sissleib6930@stu.howardcollege.edu:Not-Engaged
into the expected text :
ernestobaltar@yahoo.com:Golden-Ball:Email.yahoo.com
amaury.tenaille@epfedu.fr:SilverBall:Email.epfedu.fr
Inspirit@staplesnet.us:Copper_Ball:Email.staplesnet.us
Matthewsk@mail.montclair.edu:Encourage:Email.mail.montclair.edu
sissleib6930@stu.howardcollege.edu:Not-Engaged:Email.stu.howardcollege.edu
Notes :
In the search regex :
First, the (?-s) ensures that any regex symbol . will match a single standard character, only and not EOL chars
Then the part @(.+): searches for the @ character followed with a non-null range of chars till a colon :. Note that this range is stored as group 1 because of the parentheses
The final part .+ represents the characters after the colon char of each line
In the replacement regex :
We first insert the overall pattern $0. So, everything between the @ char and the end of current line
Then, we write the literal string :Email.
-Finally, we re- write the contents of Group 1, so the name of each site, thanks to the \1 syntax
Best Regards,
guy038