The length is 8-20 characters. There are at least three kinds of letters, numbers, uppercase and punctuation. Spaces and Chinese characters are not allowed
I don't think this is necessarily handled by a regular formula, at least not by a regular formula“ There are at least three kinds of letters, numbers, uppercase and punctuation marks. "In fact, the accurate description here is" there are at least three kinds of lowercase letters, numbers, uppercase and punctuation marks. "This is what regular expressions can't deal with simply. I have to deal with it
This is generally used to set the password requirements.
Generally, there are at least one and at least three kinds of regularities
The requirements are not very clear, and a rule can not satisfy all the conditions at the same time, especially including at least three, which need to be judged separately. What's more, we should make it clear what punctuation marks mean. These words are too general.
if(val.test(/[A-z0-9\.\,\:\'\"\`\?\!]{8,20}/)&&val.test(/[A-z]/)&&val.test(/[0-9]/)&&val.test(/\.\,\:\'\"\`\?\!/)){};