I have the following regular expression
^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$
Which validates that the expression has uppercase, lowercase and numbers,
What I haven't been able to add are optional special signs try with
^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]?[.]{8,}$
in theory the ?
should be optional, I'm pretty new to this regex, I appreciate any help
To validate at least eight characters with at least one uppercase letter and special character you can use:
You can use https://www.regextester.com/ to perform validation:
If you want the special characters to be optional, simply remove this part: (?=. [@$!% ?&]) from the previous REGEX and it would look like this:
I'm not very good with Regex I'm also a beginner but I hope this works
Check this page it can also help you (I hope it has been useful)
Regex An Introduction