I have this RegEx that is used to verify that the user enters
It must be a value of 8-16 characters long and may contain ONE of certain special characters.
/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[:;#~]).{8,16}$"
I am not trying to show a warning if the user enters something that does not match the above. So az, AZ, 0-9 and are :;#~allowed, but everything else shows a warning.
So, Abcd1234#in order, but if they enter Abcd1234!$, if a warning is displayed like !they $do not match.
I tried adding ^ to the beginning of a character match to try to cancel them, but that didn't work.
What is the best way to do this?
source
share