use strict; use warnings; for (qw(12.34 0.05lb 999)) { if($_=~/([0-9.]+)/) { print "$1\n"; } }