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.

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Kudoed Authors
Users online (1,847)