in reply to How to match repeating characters
It's not clear if you mean consecutive repeating or more than 2 repeats anywhere. If the latter, this might work:
c:\test>p1 { printf "password: "; chomp( my $pass = <STDIN> ); redo if $pass =~ m[(.).*\1.*\1]; print "'$pass' Ok"; redo };; password: hello 'hello' Ok password: goodbye 'goodbye' Ok password: xxx password: xaxbxc password:
|
|---|