web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Regex Email Domain Nam...
Power Automate
Unanswered

Regex Email Domain Name Only

(0) ShareShare
ReportReport
Posted on by

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 😁

I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    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.

  • UK_Mike Profile Picture
    on at

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

     

    Thanks 😁

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    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.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Sorry, don't know regex, lol.

  • UK_Mike Profile Picture
    on at

    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 😁

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Google is friend:

    https://stackoverflow.com/questions/39027204/regex-get-domain-name-from-email

     

  • UK_Mike Profile Picture
    on at

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

    Nice try though...

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

     

    Screenshot 2022-02-16 180009.png

  • UK_Mike Profile Picture
    on at

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

     

    Screenshot 2022-02-16 180256.png

  • Verified answer
    yoko2020 Profile Picture
    495 on at

    @UK_Mike 

     

    Try this

    (?<=@).+?(?=\.)
  • UK_Mike Profile Picture
    on at

    Perfectoooooooooooooooo 😀

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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard