I Tried to validate a statement with below regular expression, In some of the cases it is working as expected but not in the other cases.
/^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{12,20}$/
passed scenario's
test@Test123
Failed Scenario's
test.Test123
In this scenario we can allow alphanumeric,at least one special character and length should be in between to 20 characters.