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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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
    69,567 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard