in reply to Password Regex extended

Update: Caution: The code below does not work as advertised! Unfortunately, it was tested only with passwords (I assume the intent of the code is to validate candidate passwords) that met all four of the four optional conditions. Had I tested a password meeting only three of the optional conditions, I would have seen that it was rejected as invalid. Apparently, the  {3,} quantifier at the end of the non-capturing group in the  $valid regex is simply ignored after the warning is issued and Perl just soldiers on. Nobody has called me on this, so I figure I had better 'fess up; I would not want anyone to stumble across this post in the archives someday and be misled onto the path of error. I hope they don't make me give back the XP.

Original Post:
Other than the warning (sorry for the line-wrap munging on this), the following approach seems to work. Except for explicitly suppressing the warning, can anyone think of a way to make this work 'quietly'?

>perl -wMstrict -le "my $min_10 = qr{ (?= .{10}) }xms; my $a_digit = qr{ (?= .* \d) }xms; my $a_lower = qr{ (?= .* [[:lower:]]) }xms; my $an_upper = qr{ (?= .* [[:upper:]]) }xms; my $special = qr{ [@\#\$%^&+=] }xms; my $a_spec = qr{ (?= .* $special) }xms; my $valid = qr{ \A $min_10 (?: $a_digit $a_lower $an_upper $a_spec){3,} }xms; while (chomp(my $pw = <STDIN>)) { my $ok = $pw =~ $valid; print qq{'$pw' }, $ok ? 'valid' : 'INVALID'; } " (?: (?msx-i: (?= .* \d) ) (?msx-i: (?= .* [[:lower:]]) ) (?ms +x-i: (?= . * [[:upper:]]) ) (?msx-i: (?= .* (?msx-i: [@\#\$%^&+=] )) )) +{3,} matches null string many times in regex; marked by + <-- HERE in m/ + \A (?msx -i: (?= .{10}) ) (?: (?msx-i: (?= .* \d) ) (?msx-i: +(?= .* [[: lower:]]) ) (?msx-i: (?= .* [[:upper:]]) ) (?msx-i: (?= .* (?msx-i: [@ +\#\$%^&+=] )) )){3,} <-- HERE / at -e line 1. '' INVALID ' ' INVALID x 'x' INVALID xxxxxxxxx 'xxxxxxxxx' INVALID xxxxxxxxxx 'xxxxxxxxxx' INVALID %Aa123456 '%Aa123456' INVALID %Aa1234567 '%Aa1234567' valid 1aA%23456 '1aA%23456' INVALID 1aA%234567 '1aA%234567' valid Terminating on signal SIGINT(2)