How can you change this regular expression for letters and numbers only?
I thought, believing that it should have at least 2 uppercase letters, lowercase letters and numbers, that this limits the expression to only these types of characters. But this allows unwanted characters like tildes, etc.
/^[\s]*((?=([^\s]*\d){2,})(?=([^\s]*[a-z]){2,})(?=([^\s]*[A-Z]){2,})[^\s]{8,16})[\s]*$/
source
share