Validating Email Addresses

Need to validate a list of email addresses to ensure they are in a proper format. What Regex pattern would use, and how would be implement it in UiPath?

@priyachennuru789,

Iterate through array or list of the email ids using For Each activity
Inside for each use Assign activity to validate emails id

isValidEmailId = System.Text.RegularExpressions.Regex.IsMatch(email, "^[\w\.-]+@[\w\.-]+\.\w{2,}$")

isValidEmailId will be Boolean variable

Thanks,
Ashok :slight_smile:

Hi @priyachennuru789

Can you try with Find Matching Patterns activity

Regards,

@priyachennuru789

System.Text.RegularExpressions.Regex.IsMatch(email,^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

1 Like

Hi @priyachennuru789

You can use the below regular expression to extract the email address,

[A-Za-z0-9._%±]+@[A-Za-z0-9.-]+.[A-Za-z]{2,}

image

Hope it helps!!

Using the above methods, I assume you will be able to ensure that the email addresses in your list are in a proper format. However, sometimes, it might be possible that there is a typo in an email address because of a mistake from the user’s end, but the email address seems perfect to us. Moreover, having a huge email list might contain invalid email addresses.

Therefore, having another validation step is crucial. You can consider using an email verification service, which helps you identify if the email address is valid or not. The services also identify disposable and catch all emails.

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