PHP expert |
|
Even met behulp van Google het pattern opgezocht:
<?php
if(!ereg('^(?=.*[A-Za-z])(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*[^A-Za-z0-9])(?!.*\s).{6,12}$', $_POST['password']) OR strlen($_POST['password']) < 8) { echo 'niet ok'; } else { echo 'ok'; }
?>
<?php if(!ereg('^(?=.*[A-Za-z])(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?!.*[^A-Za-z0-9])(?!.*\s).{6,12}$', $_POST['password']) OR strlen($_POST['password']) < 8) { echo 'niet ok'; } else { echo 'ok'; } ?>
Note: Bovenstaand pattern eist minimaal kleine letters EN 1 hoofdletter. |