find and replace in office

O

odnation

I have a really odd request...

I have literally thousands of domains and we are trying to add these
domains into our mail security server - but what we have are alot of
email addresses, and what we want is just the domain. For example...

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)

Eventually we I would like to just have...

*@peoplefocus.com
*@learnthenet.com
*@kingpinmedia.com

Since we have thousands of these email addresses, is there a way in
Excel or Word that I can do a "Find and Replace" to where it will take
out everything before the "@" and keep the domain name... or
everything after the "@" ???

Ive tried different combinations with wildcards and Im at wits end

Thank You much
 
J

Jay Freedman

The request isn't odd at all. But the answer is kinda complicated...

In Word, set up the wildcard replace with

Find What = ([A-Za-z0-9.-_]@)(\@)([A-Za-z0-9-_]@.[A-Za-z]@)
Replace With = *\2\3

Taking this apart, the term inside the first pair of parentheses looks for any
sequence of characters consisting of upper case letters, lower case letters,
digits, dots, hyphens, or underscores. (I may have missed a few legal
characters; if so, just include them inside the square brackets.)

The second pair of parentheses encloses an @ sign that is "escaped" with a
backslash to match an actual @ sign in the address.

The third pair of parentheses encloses a term similar to the first one but
without a dot, then a dot, and then any sequence of letters.

The replacement is a star followed by the item matched by the second term (just
the @ sign) and the item matched by the third term (the domain name).

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
 
V

Val

How about:
=REPLACE(A1,1,FIND("@", A1)-1,"*")

Where your full address is in col A, this formula in col B

Val

I have a really odd request...

I have literally thousands of domains and we are trying to add these
domains into our mail security server - but what we have are alot of
email addresses, and what we want is just the domain. For example...

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)

Eventually we I would like to just have...

*@peoplefocus.com
*@learnthenet.com
*@kingpinmedia.com

Since we have thousands of these email addresses, is there a way in
Excel or Word that I can do a "Find and Replace" to where it will take
out everything before the "@" and keep the domain name... or
everything after the "@" ???

Ive tried different combinations with wildcards and Im at wits end

Thank You much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top