Could you help with regex with following situation?
- If the string is only numbers, only lowercase char, only uppercase, or only symbols.
This is how far I got.
/[0-9]|[a-z]|[A-Z]|[!@#$%^&*)(+=._-]/
-
If the string is a mixture of the two cases(either numbers, lowercase, uppercase, or symbols)
-
If the string has at least one number, one lowercase, one uppercase, and one symbol.
/^(?=.*[a-z])(?=.*[A-Z])(?=.*d)(?=.*[@$!%*?&])[A-Za-zd@$!%*?&]$/
This is not related to password,
4) but if you want regex for a string that is consisted of numbers and alphabets and can have space in the middle (not at the start nor the end)
/^[a-zds]+$/
I would like it if someone could help me with case 2 and confirm the rest.
Thanks.