my $price = -1.500; if ( $price =~ m/^-\d+\.(\d*)$/g ) { print "matched $1 \n"; }