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 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Top Solution Authors
Top Kudoed Authors
Users online (3,913)