use strict; use warnings; for (qw(12.34% 0.05lb 999)) { my $s = $_; $s =~ s/[^\d.]//g; print "$s\n"; } __END__ 12.34 0.05 999