use strict; use warnings; use Regexp::Common; $_ = '28.56-1.22' . '-4.104/02'; my ($f, $s) = /($RE{num}{decimal}).*?($RE{num}{decimal})/; print "$f  $s\n"; __END__ 28.56  -1.22