Check Format of Email Adddress

studio
variable
string

#1

Hello All,

I have a process to send E-mails to a list of email ids from excel data,flow is working fine for correct formated E-mails, but it stops on bad formated email.

I want to check the format of Email ID given in the excel in Desicion activity and then write result.

Please Help.


#2

Hi @Aditipatil,

use “Is Match” activity
Properties

  1. input ->“arivu@xxx.yyy
    2.Pattern ->”^([\w.-]+)@([\w-]+)((.(\w){2,3})+)$"
    3.Result->(Boolean value)

you can verify the email id is correct format or not based on this Boolean value

Regards,
Arivu


Email contains Characters and Numbers
#3

Hi Aviru,

Thainks for response, few times I have achived this in normal programmings but anable to achive in UIpath.

Would you mind sharing a sample.

Rgds
Aditi


#4

Hi @Aditipatil,

Pls Follow the steps what I told before that

Check Format of Email Adddress

Regards,
Arivu


#5

hi @arivu96 it has worked thanks a lot,

I just need to chhange as your pattern was not working for “aditi.patil@gmail”

S.No String Test Result Actual
1 aditi,patil@gmail.com Not Correct Working Ok
2 aditi patil@gmail.com Not Correct Working Ok
3 aditi.patil@gmail.com Correct Working Ok
4 aditi.patil@gmail Correct No
5 aditi.patil2010@gmail.com Correct Working Ok

Rdgs
Aditi


#6

Hi @Aditipatil,

Can you try this pattern in regex

(?:[A-Za-z0-9!#%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#%&’+/=?^_`{|}~-]+)|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])")@(?:(?:A-Za-z0-9?.)+A-Za-z0-9?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-][a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])

Regards,
Arivu


#7

Hi @arivu96

this worked ok for my tested cases - "^([\w.-]+)@([\w-]+)((.(\w){2,3})+)$"
Along wiht this there is one more option given on this post

If you get chance chheck this and let me know if works

image


#8

Please watch this