I'm trying to create a validation for a password field which allows only the a-zA-Z0-9
characters and .!@#$%^&*()_+-=
I can't seem to get the hang of it.
What's the difference when using regex = /a-zA-Z0-9/g and regex = /[a-zA-Z0-9]/
and which chars from .!@#$%^&*()_+-=
are needed to be escaped?
What I've tried up to now is:
var regex = /a-zA-Z0-9!@#$%^&*)(+=._-/g
but with no success
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…