#!perl -l use strict; use warnings; my $s = 'a1b2c3'; print for $s =~ /[[:alpha:]]/g; print for $s =~ /[[:digit:]]/g; __END__ a b c 1 2 3