Hello Everyone,
I want to extract 2 values with regex from my email body, but my problem is that this body comes from a tool that delivers this part in HTML.
Do you know how I can extract “Cause” and “Fin du projet” in this case? I’ve tried Regex but it doesn’t work.
Thanks
vrdabberu
(Varunraj Dabberu)
June 17, 2024, 7:14am
2
Hi @Maxime_LAUGIER
can you share the HTML code?
Regards
vrdabberu
(Varunraj Dabberu)
June 17, 2024, 7:17am
3
Hi @Maxime_LAUGIER
Try with the below regex expression:
(?<=\>)[\s\S]*?(?=\<)
Regards
Hello, thank you for your reply
i have no matches
vrdabberu
(Varunraj Dabberu)
June 17, 2024, 7:24am
5
Can you please share the HTML code?
Regards
Anil_G
(Anil Gorthi)
June 17, 2024, 7:24am
6
@Maxime_LAUGIER
best is to use a split activity
str.Split({"<div>"},StringSplitOptions.None).Last.Split({"</div>"},StringSplitOptions.None).First.Trim
cheers
Hello @Anil_G ,
Thank you for your reply.
I don’t understand sorry, i am trying to search Split activity but can’t fint it.
Could you explain me a little bit?
Thanks
Here is the code :
“<link href="https://fonts.googleapis.com/css?family=Roboto:100,400\ ” rel="stylesheet"> \r\n\r\n\r\n <div class="body" style="background-color: #f4f4f4 ; color: #333333 ; font-size: 14px; padding: 50px 0;">\r\n <div class="container" style="background-color: #ffffff ; border-radius: 14px; border: 1px solid #e4e4e4 ; margin-left: auto; margin-right: auto; padding: 30px; width: 670px;">\r\n \r\n <div class="label" style="color: #999999 ; font-size: 12px; text-transform: uppercase;">\r\n Cause\r\n \r\n
\r\n Fin du projet\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n\r\n"
ppr
(Peter Preuss)
June 17, 2024, 7:43am
9
@Maxime_LAUGIER
use </>
from the editor when sharing code snippets
For HTML Extraction we would recommend: https://html-agility-pack.net/
Feel free also to give a try at:
1 Like
Anil_G
(Anil Gorthi)
June 17, 2024, 7:51am
10
@Maxime_LAUGIER
drag a assign (str is the input string)
requiredstringvariable = str.Split({"<div>"},StringSplitOptions.None).Last.Split({"</div>"},StringSplitOptions.None).First.Trim
cheers
Hello ppr,
I tried this activity and it still the same.
vrdabberu
(Varunraj Dabberu)
June 17, 2024, 7:54am
12
Hi @Maxime_LAUGIER
try with the below regex:
(?<=\>)\s*[A-Za-z]+[A-Za-z ]+\s*(?=\<)
Regards
ppr
(Peter Preuss)
June 17, 2024, 7:55am
13
Maxime_LAUGIER:
it still the same.
not really traceable for us as we dont know what was done in detail, and what was the input.
However, the Extract Text (from Html) can suffer from text glued together.
As mentioned:
If further assistance is needed then share with us the HTML as text file
Thank you @Anil_G , it’s works , amazing
Have a good day everyone
Thanks again
1 Like
If further assistance is needed then share with us the HTML as text file
i will do next time, thank you for your time
system
(system)
Closed
June 20, 2024, 8:04am
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.