my @g = qw(St1 St10 St2 St12 St6 St8); my @b = map {s/\D\K0+//; $_} sort map {sprintf "%s%02d", /(\D+)(\d+)/} @g;