my $password ="asdf"; if ($password =~ /(?=^asdfghjkl{3,}$)/) { print 'no sequences allowed!'; } else { print "password is okay"; } #### my $password ="asdf"; if (index("qwertyuiopasdfghjklzxcvbnm",lc($password)) > -1) { ... }