$newpasswd !~ /[A-Za-z0-9]/ means "doesn't contain letters or digits". You want
$newpasswd !~ /^[A-Za-z0-9]*$/
("isn't a string of just letters and digits")
or even
$newpasswd !~ /^[A-Za-z0-9]{6,}$/
("isn't a string of 6 or more letters and digits")
to check for a minumum length of 6 at the same time.
By the way, why are you restricting the password to those characters? It looks like you're weakening security for nothing.
In reply to Re: Quickie regular expression question.
by ikegami
in thread Quickie regular expression question.
by rementis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |