How to give regex for text box in app studio

I need to use regex for the username and password for my app. How do declare my regex for a password which must have 8 characters, 1 special character, 1 number, and 1 small and caps letter? In addition, I need to check email with regex ( Gmail, Microsoft or anything)

1 Like

HI @anglo

Can you try with this Rgular expression in Pattern

"/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.* ).{8,16}$/"

Regards
Gokul

@anglo

Try the below patterns:

Password: ^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[\W_]).{8,}$
Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

1 Like

For this password try with this
I tested and it’s working fine

^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

For reference

And for mail
Try with this pattern

^[\w\.-]+@([\w-]+\.)+[\w-]+$

Hope this helps

Cheers @anglo

1 Like

I think email works only for gmail account alone,right?

1 Like

No it works for all mail format

@anglo

1 Like

Hope it’s all clarified

Let us know for any further queries

If clarified

@anglo

how can i throw error or any text below text box to indicate conditions not satisfying regex in app studio

1 Like

Check this:

https://docs.uipath.com/apps/automation-suite/2022.4/user-guide/rule-show-message

Cool
I can use here Use Rule: Show message in UiPath apps
Refer this for more details

https://docs.uipath.com/apps/automation-cloud/latest/user-guide/rule-show-message

image

@anglo

1 Like

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