How to capture an email in a text?

Hello,

I want to get the email contained in a text.

It can have this structure “structure@structure.com” but we also have to consider that the domain may have more than one word.

“.com” can be “.something.something” or “something.something.something…”…

Thanks!

Hi @pal1910,

You can use regex to get the email.

Regards,
Arivu

1 Like

Yes, I know, but I do not know what the pattern should be.

Thanks!

Screenshot 2018-11-13 at 8.55.54 PM

Ref - Regular Expression Library

Regards,
Karthik Byggari

1 Like

Hi @pal1910,

Use Matches activity

Input : YourInput
Pattern : ^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$
Result: iEnumResult -> IEnumberable<Match>
after that use assign activity to get the data
strMailID =iEnumResult (0).ToString()

Regards,
Arivu

2 Likes