my $password ="asdf"; if ($password =~ /(?=^asdfghjkl{3,}$)/) { print 'no sequences allowed!'; } else { print "password is okay"; }