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. ;)
In reply to Re: Help with a more precise regex
by Nkuvu
in thread Help with a more precise regex
by LogicalChaos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |