my $string2 = 'A81'; my $digits = $string2 =~ /(\d)+/; #$digits now contains '1'