in reply to Count the number of matched characters
$string_to_match='QWERTAAWAAAAKAAAAAAAA'; if ( substr($string_to_match, -17) =~ y/A// >= 14 ) { print 'Correct'; } [download]