$uppercase = preg_match('@[A-Z]@', $password);
$lowercase = preg_match('@[a-z]@', $password);
$number = preg_match('@[0-9]@', $password);
if(!$uppercase || !$lowercase || !$number || strlen($password) < 8) {
// tell the user something went wrong
}
^(?=P{Ll}*p{Ll})(?=P{Lu}*p{Lu})(?=P{N}*p{N})(?=[p{L}p{N}]*[^p{L}p{N}])[sS]{8,}$
if(preg_match((?=^.{8,}$)((?=.*d)|(?=.*W+))(?![.
])(?=.*[A-Z])(?=.*[a-z]).*$, $_POST['password']):
echo 'matched';
else:
echo 'not matched';
endif;