use Regexp::Common; my @numbers = grep { $_ < 500 } m/$RE{num}{real}/g;