use warnings; use strict; my $input = 'rnbqkbnr'; $input =~ /(n)/g; print "@+\n";