You are viewing a single comment's thread. Return to all comments →
Perl solution:
sub minimumNumber { my ($n, $str) = @_; my $cnt = 0; $cnt++ if ($str !~ m/[a-z]/m); $cnt++ if ($str !~ m/[A-Z]/m); $cnt++ if ($str !~ m/[\!\@\#\$\%\^\&\*\(\)\-\+]/m); $cnt++ if ($str !~ m/\d+/m); if ($n < 6) { if ((length($str) + $cnt) < 6) { $cnt = 6 - length($str); } } return $cnt; }
Seems like cookies are disabled on this browser, please enable them to open this website
Strong Password
You are viewing a single comment's thread. Return to all comments →
Perl solution: