a similar code checks a text string with a different regular routine with a bang, I will not say that the code is super but it works, when checking the password and replacing the regular, nothing works, the question is in the regular database, or is the password not readable because the password type? or something else?
<div class="rov"> <div class="col-md-3"> <label for="pass_1">Пароль</label> </div> <div class="col-md-7"> <input type="password" onkeyup="ValidPassw()" id="pass_1" class="form-control" placeholder="Пароль" > </div> <div class="col-md-1"> <span class="glyphicon glyphicon-ok" style="display:none;color:green;" aria-hidden="true" id="okPass"></span> <span class="glyphicon glyphicon-remove" style="display:none;color:red;" aria-hidden="true" id="noPass"></span> </div> </div> <script type="text/javascript"> function ValidPassw() { var P = ((?=.*\d)(?=.*[az])(?=.*[AZ]).{8,15}) ; var Pass = document.getElementById('pass_1').value; var valid = P.test(pass); if (valid) { document.getElementById('okPass').style.display = 'block'; document.getElementById('noPass').style.display = 'none'; } else { document.getElementById('okPass').style.display = 'none'; document.getElementById('noPass').style.display = 'block'; } return valid; }; </script >