if ( "aab" =~ /(.)\1(*SKIP)(*FAIL)|.*/ ) { say $&; # b }