cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
UK_Mike
Post Prodigy
Post Prodigy

Regex Email Domain Name Only

Hi All,

 

Looking to extract just the domain name, no suffix.

Below regex works perfect, except for .co.uk  , or any other with more than one " . "  🙄

 

(?<=@).*(?=\.)

 

info@Amazon.co.uk
info@Amazon.com
sales@Amazon.com
info.more@Ebay.com
info@ebay.co.uk
info@Ebay.com
sales@ebay.com
info.more@Ebay.de
info.more@Ebay.cn
info.more@Ebay.ke
info.more@Ebay.ie

 

Many thanks 😁

1 ACCEPTED SOLUTION

Accepted Solutions
yoko2020
Responsive Resident
Responsive Resident

@UK_Mike 

 

Try this

(?<=@).+?(?=\.)

View solution in original post

10 REPLIES 10
Pstork1
Dual Super User
Dual Super User

Wouldn't it be easier and more reliable just to use the Text Split() function on the '@',which will create a list of two elements and then remove the first element by index.  That would leave you with the domain in all cases since addresses are only allowed to use the @ once.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Hi, maybe I should have explained a bit further, im in testing mode, will try split text another time...

 

Thanks 😁

MichaelAnnis
Super User
Super User

I'm with @PSTR.

 

For each %CurrentItem% in List %Emails%
Parse Text on %CurrentItem% finding the "@" symbol.  This will give you the position just before "@" (0 based index).

Get Subtext starting at Position to the end of the text.

Sorry, don't know regex, lol.

Me neither !!!  😂

Well a bit I suppose....

 

More than one way to skin a cat etc, just trying this way first is all.

Thanks guys 😁

 

Nope.................... 😂

Nice try though...

I can get what I want provided theres only one " . " after the domain name...

 

Screenshot 2022-02-16 180009.png

This the best I can get....... 

 

Screenshot 2022-02-16 180256.png

yoko2020
Responsive Resident
Responsive Resident

@UK_Mike 

 

Try this

(?<=@).+?(?=\.)

Perfectoooooooooooooooo 😀

Cheers man, jeez I was close, that bit in the middle 🙄

 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Top Solution Authors
Users online (3,626)