my %t = reverse ($value =~ /(\d+)([dh])/g); my $day = $t{d} || 0; my $hour = $t{h} || 0;