Hi Experts
I need to extract the e-mail address from a filename string looking similar to this:
“Firstname Lastname mailaddress@contoso.com_3_Receiver.pdf”
The result should be “mailaddress@contoso.com” - can this be achieved by using regex?
Hi Experts
I need to extract the e-mail address from a filename string looking similar to this:
“Firstname Lastname mailaddress@contoso.com_3_Receiver.pdf”
The result should be “mailaddress@contoso.com” - can this be achieved by using regex?
Use this Regex pattern in Match Activity.
[a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+.[a-zA-Z.]+
To check this, use https://regexr.com/
check this out, this wil extract any type of email:
([a-zA-Z0-9_-.]+)@([a-zA-Z0-9_-.]+).(?=[\*])
Hi @jacchr,
Considering this won’t be the only email ID format you get, I’ve prepared a regex for you which covers some possible and common formats:
([\w.]+)@([a-z.]+)(.)([a-z]+)
Note: the regex doesn’t match “jacchr.rpa@uipath” as it doesn’t have a period mark (.) after @
Thank you all for your reply.
Based on your input I have put it into the following regex command:
([\w.-]+)@([\w.-]+).([a-zA-Z]+)
I believe this should allow a-z, 0-9, . (period), _ (underscore) and - (hyphen) before and after @ and only a-z after the last . (period).