my $str = '--------------- 1.74 --> 1.75 :test/document.txt'; my ($values,$cf) = $str =~ /([\d.]+)\s*-->\s*([\d.]+)/; print "$values,$cf\n"; __END__ 1.74,1.75