in reply to Help with a more precise regex
It could be painfully obvious (just suggested as an alternative):
if ($value =~ /^(\d+)d$/i) { $day = $1; } elsif ($value =~ /^(\d+)d\s+(\d+)h$/i) { $day = $1; $hour = $2; } elsif ($value =~ /^(\d+)h$/i) { $hour = $1; } else { print "Hork!\n"; }
What exactly do you want out of this?
Update: Sorry, just ignore this post. It's too ugly to live. ;)
|
|---|