Checking the password thru Regex via Shell Script

All,
I'm new to shell script. How do I check the password

1)password should have atleast one alpha character and one non-alpha character (0-9 Special)

2)password should not contain three or more repeated alpha numeric characters in a row

Can somebody help me in creating the regular expression for the above conditions

Thanks
Subbarao

$
$ cat testpswd.txt
Ab~18b-y
abcd
1234
bi!n!go
!~!~^#()
!~ab^#()
!~abcde)
Ro!ad&wy
Ro!m$&#y
$
$ ##
$ cat testpswd.txt |
> perl -nle 'printf("%-10s\t",$_);
>            if(/[a-zA-Z]+/ && /[^a-zA-Z]+/ && !/[0-9a-zA-Z]{3,}/){
>              print "Valid";
>            } else {
>              print "Invalid";
>            }'
Ab~18b-y        Invalid
abcd            Invalid
1234            Invalid
bi!n!go         Valid
!~!~^#()        Invalid
!~ab^#()        Valid
!~abcde)        Invalid
Ro!ad&wy        Valid
Ro!m$&#y        Valid
$
$

tyler_durden