How to get an email contained in a text?


I have got a text that contains an email “

I would like how I could get such an email.

An example of the text could be:

“odkso example of the text this is nsok2”


I would use a split string activity and then loop through each index using regex matches to find the index that contains the email.

1 Like

A Regex pattern might look like this:

pattern = "(?<=(\s|^))(.*)\@(.*)(?=(\s|$))"

Then, place that in a Regex line like this:
System.Text.RegularExpressions.Regex.Match(text, pattern).Value
Note: if System.Text.RegularExpressions namespace is imported, you can leave off that part

Hope that helps.


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.