Hello,
I want to extract email id from a string.
I will have multiple emails.
<div class="ExternalClass9E13B"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><span style="color:black;"></span>abc@gmail.com; sac@gmail.com</div></div>
I need to get: abc@gmail.com; sac@gmail.com
Thanks!
Solved! Go to Solution.
@Anonymous ,
I had another go at this, but note this will only work if you have a consistent number of ">" symbols before the emails (I have used 3 here - the email/s are the fourth split) and a ">" symbol directly after.
With(
{
wSplit:
Last(
FirstN(
Split(
YourHTMLText,
">"
),
4
).Result
).Result
},
Left(
wSplit,
Find(
"<",
wSplit
) - 1
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Anonymous ,
Like this
First(
Split(
Last(
Split(
YourText,
"</span>"
)
).Result,
"</div>"
)
).Result
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hello,
Thank you for the reply.
This formula doesn't work for a single email id.
Single email :
<div class="ExternalClass2B"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><span style="color:black;">pp@gmail.com</span><br></div></div>
Multiple emails:
<div class="ExternalClas17"><div style="font-family:Calibri, Arial, Helvetica, sans-serif;font-size:11pt;color:rgb(0, 0, 0);"><span style="color:black;"></span>ab@gmail.com;sn@gmail.com</div></div>
Thank you.
@Anonymous ,
Thanks for the Kudo - is this now solved?
Hello,
Nope as i mentioned in my previous reply.
The formula u have suggested applies for only multiple mails but not single mail.
Please help me on this.
Thanks.
@Anonymous .
That was not the code you posted - the single one has a different span code before and a different code after it - you cannot do this without consistent code before and after the emails.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@Anonymous ,
I had another go at this, but note this will only work if you have a consistent number of ">" symbols before the emails (I have used 3 here - the email/s are the fourth split) and a ">" symbol directly after.
With(
{
wSplit:
Last(
FirstN(
Split(
YourHTMLText,
">"
),
4
).Result
).Result
},
Left(
wSplit,
Find(
"<",
wSplit
) - 1
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Can we get it by using "@gmail.com" in the formula ?
Thanks.
Thanks, @WarrenBelz providing the formula/code.
Hi @Anonymous By Looking at the Div tag, looks like you need to extract email id's from the Power Automate.
If this is true please post your question to the Power Automate forum and tag me. So that I can post my answer over there and help others in the future.
Example (Extracted emails)
@Anonymous ,
You did not say it was always going to be gmail.com (my brain hurts enough doing the last two). I had a bit of a go, but you still need to allow for one or many email addresses (I assume) and they have different things before and after them if you split at gmail.
User | Count |
---|---|
251 | |
102 | |
94 | |
47 | |
37 |