String Operation to extract Email Id from a String

Hi All,

I am trying to perform a string operation where i need to get the email id from the string say for example like below,
sumit kumar <sumit.kumar@gmail.com>

From the above string value i have to get only the email id i.e “sumit.kumar@gmail.com”, can someone please help me.

Thanks,
Sumit

Hello

You can use Regex :slight_smile:

Try this Regex pattern in a “Matches” activity:
(?<=<).*(?=>)
Regex Preview here

Then use an assign activity to convert the result to a string like this.
Stringresult = MATCHESRESULT(0).tostring

Update the capital letters in the previous line with the actual output variable from the matches activity.

If you want to learn Regex - check out my Regex MegaPost for new users.

Cheers

Steve

3 Likes

Can we do the same with String Operation such as split or Substring?

Sure but it will be about the same number of steps.

You would need to split by “>” then by “<“.

Check this String manipulation MegaPost by @Adrian_Star

Cheers

Steve