URL from mail body


Can any one suggest a way for extracting URL from the Body(where body may contain some other matter which we no need to bother,need to extract only Url) of mail and hit that URL in IE browser.

Thanks and Regards,

1 Like

This is one way.Below link has everything needed

can you tell how to use this regular expression "(?<=HYPERLINK ")(.*)(?=“Click)” in uipath code

Highlighed one. If you are expecting only one email, then instead of foreach

“(?<=HYPERLINK “+chr(34)+”)(.*)(?=”+chr(34)+“click)”

Validate your output – If (matchesOutout.Count >0) matchOutput(0).ToString

I used that activity and I tried with both regular expressions (?<=HYPERLINK “)(.)(?=“Click) ,”(?<=HYPERLINK “+chr(34)+”)(.)(?=”+chr(34)+“click)” and [1]+|(?<=().+?(?=))|[^)]+$ also, But its showing this error , when I am trying to show that URL by using message box.Here I am attaching screenshot

Here is the message that my string is hodling

  1. ^( ↩︎

sample.xaml (5.8 KB)

Forgot to mention my regex applies if the Url embedded in below way, replace click in regex with your link Alias name.

One doubt…the code you shared,will it work
1.if body of mail containig some other matter along with URL
2.Can you share a screen shot of Success case like printing the whole string(entire body content) in message box and then only extracting statring and ending part of URL


Let me know how your URL will be sent in the Email

— Click Here with HyperLink

— Direct URL — In this case just your Regex will change.


Yes #vvaidya,

Thank you for your response. It’s working fine.

Thanks a lot.

similar to the sample i shared, just update the pattern with new Regex.Share your workflow if it doesn’t work.

Vvaidya,Thank you its working


Instead of displaying it in Message box,i need to click the url in the email body.Help me to do that.

Thanks in advance :slight_smile:

Hi #vvaidya,

I have the same issue, but with a click here with hyperlink, how can I get the hyperlink directly ?

Thanks in advance.