Fetch url from outlook e mail body

Hi @Aleem_Khan

There are two methods to extract Url from Email

1 ) Matches activity
In the matches activity click configure regular expressions and Choose regex dropdown as Url
image
pass input string as email body variable and create a output variable in result tab
Finally output variable holds Url value

2)using regex in assign activity

you have to create a variable Like *Str_Out

Str_Out=System.Text.RegularExpressions.Regex.Match(your_email_body_string_variable, “(?:(?:https?|ftp|file)://|www.|ftp.)(?:([-a-zA-Z0-9+&@#/%=~|$?!:,.]*)|[-a-zA-Z0-9+&@#/%=~|$?!:,.])(?:([-a-zA-Z0-9+&@#/%=~_|$?!:,.])|[a-zA-Z0-9+&@#/%=~_|$])”).Value

Finally Str_Out holds the url value

Regards
Robin S

1 Like