Help for this page
'okoK'=~ /^(o|k)(k|i)(O|K)(K)/
'okoK'=~ / ^ ... use List::Util qw( first ); my $n = first { defined($-[$_]) } 1..4;